diff options
author | lokher <lokher@gmail.com> | 2022-09-13 11:24:05 +0800 |
---|---|---|
committer | lokher <lokher@gmail.com> | 2022-09-13 11:24:05 +0800 |
commit | 9581289745736ce068a1040f44cec37a2ca8830d (patch) | |
tree | 24f644715a5fd6cc4d804d9604fb094307808b1b /keyboards/matrix/m20add/m20add.c | |
parent | fe13cedf8c09fa34d5cec4e4c624738095176625 (diff) |
Remove non-Keychron keyboards
Diffstat (limited to 'keyboards/matrix/m20add/m20add.c')
-rw-r--r-- | keyboards/matrix/m20add/m20add.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/keyboards/matrix/m20add/m20add.c b/keyboards/matrix/m20add/m20add.c deleted file mode 100644 index cdcafb9779..0000000000 --- a/keyboards/matrix/m20add/m20add.c +++ /dev/null @@ -1,66 +0,0 @@ -/** - * m20add.c - */ - -#include "m20add.h" -#include "tca6424.h" -#include "rgb_ring.h" -#include "i2c_master.h" - -void set_pin(uint16_t pin) -{ - uint8_t data = tca6424_read_port(GET_PORT(pin)); - data |= ( 1 << GET_PIN(pin)); - tca6424_write_port(GET_PORT(pin), data); -} - -void clear_pin(uint16_t pin) -{ - uint8_t data = tca6424_read_port(GET_PORT(pin)); - data &= ~( 1 << GET_PIN(pin)); - tca6424_write_port(GET_PORT(pin), data); -} - -uint8_t read_pin(uint16_t pin) -{ - uint8_t data = tca6424_read_port(GET_PORT(pin)); - return (data & (1<<GET_PIN(pin))) ? 1 : 0; -} - -void matrix_init_kb(void) { -#ifdef RGBLIGHT_ENABLE - rgb_ring_init(); -#endif - matrix_init_user(); -} - -void matrix_scan_kb(void) { -#ifdef RGBLIGHT_ENABLE - rgb_ring_task(); -#endif - matrix_scan_user(); -} - -static uint16_t caps_lock_pin = DEF_PIN(TCA6424_PORT2, 3); -static uint16_t scroll_lock_pin = DEF_PIN(TCA6424_PORT0, 1); - -bool led_update_kb(led_t led_state) { - bool res = led_update_user(led_state); - if (res) { - led_state.caps_lock ? set_pin(caps_lock_pin) : clear_pin(caps_lock_pin); - led_state.scroll_lock ? set_pin(scroll_lock_pin) : clear_pin(scroll_lock_pin); - } - return res; -} - -#define REBOOT_MAGIC 0x41544B42 -void shutdown_user(void) -{ - // set the magic number for resetting to the bootloader - *(uint32_t *)(&(RTCD1.rtc->BKP0R)) = REBOOT_MAGIC; -} - -void bootloader_jump(void) { - shutdown_user(); - NVIC_SystemReset(); -} |