Archivado
1
0
Este repositorio está archivado. Usted puede ver los archivos y clonarlos, pero no puede hace push o abrir incidencias o pull requests.
keybrd/src/LayerState.cpp
2016-09-19 19:46:03 -06:00

33 líneas
628 B
C++

#include "LayerState.h"
void LayerState::hold(const uint8_t layerId)
{
setActiveLayer(layerId);
}
void LayerState::unhold(const uint8_t layerId)
{
if (layerId == activeLayer);
{
setActiveLayer(lockedLayer);
}
}
void LayerState::lock(const uint8_t layerId)
{
setActiveLayer(layerId);
lockedLayer = layerId;
}
/*Derived classes override setActiveLayer() to also set LED indicator lights e.g. LayerState_LED
*/
void LayerState::setActiveLayer(const uint8_t layerId)
{
activeLayer = layerId;
}
uint8_t LayerState::getActiveLayer()
{
return activeLayer;
}