Lift out the LED brightness into a global
Instead of passing the same constant to LedDisplay_SetLayerLed() all the time, lift it out into a global. Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
This commit is contained in:
@@ -4,8 +4,10 @@
|
||||
#define LAYER_LED_FIRST FRAME_REGISTER_PWM_FIRST + 13
|
||||
#define LAYER_LED_DISTANCE 16
|
||||
|
||||
void LedDisplay_SetLayerLed(uint8_t layerId, uint8_t brightness) {
|
||||
uint8_t LedDisplayBrightness = 0xff;
|
||||
|
||||
void LedDisplay_SetLayerLed(uint8_t layerId) {
|
||||
for (uint8_t i = 0; i < LAYER_COUNT; i++) {
|
||||
LedDriver_WriteRegister(I2C_ADDRESS_LED_DRIVER_LEFT, LAYER_LED_FIRST + (i * LAYER_LED_DISTANCE), brightness * (layerId == i + 1));
|
||||
LedDriver_WriteRegister(I2C_ADDRESS_LED_DRIVER_LEFT, LAYER_LED_FIRST + (i * LAYER_LED_DISTANCE), LedDisplayBrightness * (layerId == i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user