diff --git a/keyboard/smart68/Makefile b/keyboard/smart68/Makefile index 55c78da8..ec8b8d73 100644 --- a/keyboard/smart68/Makefile +++ b/keyboard/smart68/Makefile @@ -131,6 +131,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 +BREATHING_LED_ENABLE = yes # Enable breathing backlight # Optimize size but this may cause error "relocation truncated to fit" diff --git a/keyboard/smart68/backlight.c b/keyboard/smart68/backlight.c index 84c753af..89434a48 100644 --- a/keyboard/smart68/backlight.c +++ b/keyboard/smart68/backlight.c @@ -19,6 +19,7 @@ along with this program. If not, see . #include #include #include "backlight.h" +#include "breathing_led.h" static const uint8_t backlight_table[] PROGMEM = { 0, 16, 128, 255 @@ -27,26 +28,68 @@ static const uint8_t backlight_table[] PROGMEM = { /* Backlight pin configuration * PWM: PB7 */ +void backlight_enable(void) +{ + // Turn on PWM + cli(); + DDRB |= (1< 0) { - // Turn on PWM - cli(); - DDRB |= (1<. #define DEBOUNCE 5 /* number of backlight levels */ +#ifdef BREATHING_LED_ENABLE +#define BACKLIGHT_LEVELS 6 +#else #define BACKLIGHT_LEVELS 3 +#endif /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE