diff --git a/keyboard/RedScarfII/backlight.c b/keyboard/RedScarfII/backlight.c index e49d33e5..c2aa615f 100644 --- a/keyboard/RedScarfII/backlight.c +++ b/keyboard/RedScarfII/backlight.c @@ -1,5 +1,5 @@ /* -Copyright 2013,2014 Kai Ryu +Copyright 2014 Kai Ryu This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,64 +28,61 @@ along with this program. If not, see . #ifdef BACKLIGHT_ENABLE -static uint8_t backlight_mode; - static const uint8_t backlight_table[] PROGMEM = { 0, 16, 128, 255 }; -void backlight_enable(void); -void backlight_disable(void); inline void backlight_set_raw(uint8_t raw); +#ifdef SOFTPWM_LED_ENABLE +#ifdef FADING_LED_ENABLE +static uint8_t backlight_mode; +#endif +#endif + /* Backlight pin configuration * PWM: PB7(OC1C) */ +#ifndef SOFTPWM_LED_ENABLE void backlight_enable(void) { -#ifdef SOFTPWM_LED_ENABLE - DDRB |= (1<. #include "keymap_common.h" /* translates key to keycode */ -uint8_t keymap_key_to_keycode(uint8_t layer, key_t key) +uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key) { #ifndef KEYMAP_IN_EEPROM_ENABLE return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]); diff --git a/keyboard/RedScarfII/ledmap.c b/keyboard/RedScarfII/ledmap.c index f177c37e..4f95ee6a 100644 --- a/keyboard/RedScarfII/ledmap.c +++ b/keyboard/RedScarfII/ledmap.c @@ -20,16 +20,16 @@ along with this program. If not, see . #ifdef LEDMAP_ENABLE -static const uint8_t ledmaps[LED_COUNT] PROGMEM = { +static const uint16_t ledmaps[LED_COUNT] PROGMEM = { [0] = LEDMAP_CAPS_LOCK | LEDMAP_BACKLIGHT, // CapsLock [1] = LEDMAP_NUM_LOCK | LEDMAP_BACKLIGHT, // NumLock [2] = LEDMAP_SCROLL_LOCK | LEDMAP_BACKLIGHT, // Logo [3] = LEDMAP_BACKLIGHT, // Backlight }; -uint8_t ledmap_get_code(uint8_t index) +ledmap_t ledmap_get_code(uint8_t index) { - return pgm_read_byte(&ledmaps[index]); + return (ledmap_t) { .code = pgm_read_word(&ledmaps[index]) }; } /* LED pin configration @@ -64,6 +64,7 @@ void ledmap_led_on(uint8_t index) break; case 3: PORTB |= (1<