Archived
1
0
This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
keybrd/src/LayerState_LED.h

25 lines
809 B
C

2016-07-18 02:03:03 +00:00
#ifndef LAYERSTATE_LED_H
#define LAYERSTATE_LED_H
#include <Arduino.h>
#include <inttypes.h>
#include "LayerState.h"
#include "LEDInterface.h"
2016-07-18 02:03:03 +00:00
/* Basic LayerState with layer LED indictor lights.
begin() should be called once to turn on LED for initial active layer.
If LED is on Scanner_IOE, LayerState_LED::begin() should be called after Scanner_IOE::begin()
so that scanner's ports can turn on LayerState_LED's default-layer LED.
2016-07-18 02:03:03 +00:00
*/
class LayerState_LED : public LayerState
{
private:
2016-09-25 03:58:54 +00:00
LEDInterface*const *const ptrsLEDs; //array of LEDs, where layerId is array index
2016-09-20 01:46:03 +00:00
virtual void setActiveLayer(const uint8_t layerId);//set active layerId and turn on it's LED
2016-07-18 02:03:03 +00:00
public:
2016-09-25 03:58:54 +00:00
LayerState_LED(LEDInterface*const ptrsLEDs[]): ptrsLEDs(ptrsLEDs) {}
2016-07-18 02:03:03 +00:00
void begin();
};
#endif