diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2022-09-25 16:02:54 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2022-09-25 16:02:54 +0200 |
commit | 6afdd9d74da250e47ac64d6690bd19d037045e99 (patch) | |
tree | 661f6cfb244c02bcd1fbfe8fb9b2bd9242a91394 /drivers/led/ckled2001.c | |
parent | 93a55e61b59d20f7cd842cce02e5b18a63a23612 (diff) | |
parent | 1bdf4cdc22ae57d111efb2f7d71e405e5c7b3f11 (diff) | |
download | qmk_firmware-6afdd9d74da250e47ac64d6690bd19d037045e99.tar.gz qmk_firmware-6afdd9d74da250e47ac64d6690bd19d037045e99.zip |
Merge branch 'master' into taamas
Diffstat (limited to 'drivers/led/ckled2001.c')
-rw-r--r-- | drivers/led/ckled2001.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/led/ckled2001.c b/drivers/led/ckled2001.c index 8d71805a24..b7e7db06cc 100644 --- a/drivers/led/ckled2001.c +++ b/drivers/led/ckled2001.c @@ -30,6 +30,11 @@ # define PHASE_CHANNEL MSKPHASE_12CHANNEL #endif +#ifndef CKLED2001_CURRENT_TUNE +# define CKLED2001_CURRENT_TUNE \ + { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } +#endif + // Transfer buffer for TWITransmitData() uint8_t g_twi_transfer_buffer[20]; @@ -123,18 +128,10 @@ void CKLED2001_init(uint8_t addr) { } // Set CURRENT PAGE (Page 4) + uint8_t current_tuen_reg_list[LED_CURRENT_TUNE_LENGTH] = CKLED2001_CURRENT_TUNE; CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, CURRENT_TUNE_PAGE); for (int i = 0; i < LED_CURRENT_TUNE_LENGTH; i++) { - switch (i) { - case 2: - case 5: - case 8: - case 11: - CKLED2001_write_register(addr, i, 0xA0); - break; - default: - CKLED2001_write_register(addr, i, 0xFF); - } + CKLED2001_write_register(addr, i, current_tuen_reg_list[i]); } // Enable LEDs ON/OFF @@ -220,14 +217,14 @@ void CKLED2001_update_led_control_registers(uint8_t addr, uint8_t index) { g_led_control_registers_update_required[index] = false; } -void CKLED2001_return_normal(uint8_t addr) { +void CKLED2001_sw_return_normal(uint8_t addr) { // Select to function page CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, FUNCTION_PAGE); // Setting LED driver to normal mode CKLED2001_write_register(addr, CONFIGURATION_REG, MSKSW_NORMAL_MODE); } -void CKLED2001_shutdown(uint8_t addr) { +void CKLED2001_sw_shutdown(uint8_t addr) { // Select to function page CKLED2001_write_register(addr, CONFIGURE_CMD_PAGE, FUNCTION_PAGE); // Setting LED driver to shutdown mode |