Files
firmware/right/src/led_display.c
Gergely Nagy a59dcd1662 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>
2016-12-13 23:23:16 +01:00

14 lines
423 B
C

#include "led_display.h"
#include "layer.h"
#define LAYER_LED_FIRST FRAME_REGISTER_PWM_FIRST + 13
#define LAYER_LED_DISTANCE 16
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), LedDisplayBrightness * (layerId == i + 1));
}
}