1
0

Add macro for compiling with led matrix disabled

This commit is contained in:
Kai Ryu 2014-04-11 17:29:57 +09:00
parent 9a6b1cc49d
commit f56f9030f6
2 changed files with 4 additions and 2 deletions

View File

@ -138,7 +138,7 @@ NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
KEYMAP_EX_ENABLE = yes # External keymap in eeprom
KEYMAP_SECTION_ENABLE = yes # Fixed address keymap for keymap editor
LED_MATRIX_ENABLE = yes
#LED_MATRIX_ENABLE = yes
# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax

View File

@ -51,13 +51,14 @@ void backlight_set(uint8_t level)
OCR1B = 0;
}
}
#elif #defined(GH60_REV_CNY)
#elif defined(GH60_REV_CNY)
static const uint8_t backlight_table[] PROGMEM = {
0, 16, 128, 255
};
void backlight_set(uint8_t level)
{
#ifdef LED_MATRIX_ENABLE
if (level > 0) {
led_matrix_disable();
for (uint8_t row = 0; row < LED_MATRIX_ROWS; row++) {
@ -70,6 +71,7 @@ void backlight_set(uint8_t level)
else {
led_matrix_disable();
}
#endif
}
#else
static const uint8_t backlight_table[] PROGMEM = {