1
0

Add init callback function to softpwm_led

This commit is contained in:
Kai Ryu 2014-08-03 12:00:18 +09:00
parent fbbcf3ce0c
commit f179c9a04a
4 changed files with 13 additions and 6 deletions

View File

@ -91,18 +91,18 @@ void keyboard_init(void)
ledmap_init(); ledmap_init();
#endif #endif
#ifdef BACKLIGHT_ENABLE
backlight_init();
#endif
#ifdef SOFTPWM_LED_ENABLE #ifdef SOFTPWM_LED_ENABLE
softpwm_led_init(); softpwm_init();
#endif #endif
#ifdef BREATHING_LED_ENABLE #ifdef BREATHING_LED_ENABLE
breathing_led_init(); breathing_led_init();
#endif #endif
#ifdef BACKLIGHT_ENABLE
backlight_init();
#endif
#ifdef KEYMAP_IN_EEPROM_ENABLE #ifdef KEYMAP_IN_EEPROM_ENABLE
keymap_in_eeprom_init(); keymap_in_eeprom_init();
#endif #endif

View File

@ -83,6 +83,10 @@ void layer_state_change(uint32_t state)
#endif #endif
#ifdef SOFTPWM_LED_ENABLE #ifdef SOFTPWM_LED_ENABLE
void softpwm_led_init(void)
{
}
void softpwm_led_on(uint8_t index) void softpwm_led_on(uint8_t index)
{ {
if (backlight_binding & LED_BIT(index)) { if (backlight_binding & LED_BIT(index)) {

View File

@ -11,7 +11,7 @@ static uint8_t softpwm_led_state = 0;
static uint8_t softpwm_led_ocr[LED_COUNT] = {0}; static uint8_t softpwm_led_ocr[LED_COUNT] = {0};
static uint8_t softpwm_led_ocr_buff[LED_COUNT] = {0}; static uint8_t softpwm_led_ocr_buff[LED_COUNT] = {0};
void softpwm_led_init(void) void softpwm_init(void)
{ {
#ifdef SOFTPWM_LED_TIMER3 #ifdef SOFTPWM_LED_TIMER3
/* Timer3 setup */ /* Timer3 setup */
@ -38,6 +38,7 @@ void softpwm_led_init(void)
OCR1AL = SOFTPWM_LED_TIMER_TOP & 0xff; OCR1AL = SOFTPWM_LED_TIMER_TOP & 0xff;
SREG = sreg; SREG = sreg;
#endif #endif
softpwm_led_init();
} }
void softpwm_led_enable(void) void softpwm_led_enable(void)

View File

@ -8,6 +8,7 @@ typedef led_pack_t led_state_t;
#ifdef SOFTPWM_LED_ENABLE #ifdef SOFTPWM_LED_ENABLE
void softpwm_init(void);
void softpwm_led_init(void); void softpwm_led_init(void);
void softpwm_led_enable(void); void softpwm_led_enable(void);
void softpwm_led_disable(void); void softpwm_led_disable(void);
@ -43,6 +44,7 @@ void breathing_led_set_duration_all(uint8_t dur);
#else #else
#define softpwm_init()
#define softpwm_led_init() #define softpwm_led_init()
#define softpwm_led_enable() #define softpwm_led_enable()
#define softpwm_led_disable() #define softpwm_led_disable()