Browse Source

Add macro for compiling with led matrix disabled

led_matrix
Kai Ryu 10 years ago
parent
commit
f56f9030f6
2 changed files with 4 additions and 2 deletions
  1. 1
    1
      keyboard/gh60/Makefile
  2. 3
    1
      keyboard/gh60/backlight.c

+ 1
- 1
keyboard/gh60/Makefile 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

+ 3
- 1
keyboard/gh60/backlight.c 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 = {