keybrd library is an open source library for creating custom-keyboard firmware.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

123456789101112131415161718192021222324
  1. #ifndef LAYERSTATE_LED_H
  2. #define LAYERSTATE_LED_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include "LayerState.h"
  6. #include "LEDInterface.h"
  7. /* Basic LayerState with layer LED indictor lights.
  8. begin() should be called once to turn on LED for initial active layer.
  9. If LED is on Scanner_IOE, LayerState_LED::begin() should be called after Scanner_IOE::begin()
  10. so that scanner's ports can turn on LayerState_LED's default-layer LED.
  11. */
  12. class LayerState_LED : public LayerState
  13. {
  14. private:
  15. LEDInterface*const *const ptrsLEDs; //array of LEDs, where layerId is array index
  16. virtual void setActiveLayer(const uint8_t layerId);//set active layerId and turn on it's LED
  17. public:
  18. LayerState_LED(LEDInterface*const ptrsLEDs[]): ptrsLEDs(ptrsLEDs) {}
  19. void begin();
  20. };
  21. #endif