L3 fixed wireless LED indication, added Win locking indication, tidied up code

This commit is contained in:
lokher 2024-11-28 11:32:38 +08:00
parent 1e72758c02
commit 161a6984ba
15 changed files with 82 additions and 96 deletions

View file

@ -18,28 +18,17 @@
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
/* RGB Matrix driver configuration */ /* RGB Matrix driver configuration */
# define DRIVER_COUNT 2
# define RGB_MATRIX_LED_COUNT 86 # define RGB_MATRIX_LED_COUNT 86
# define DRIVER_COUNT 2
# define SPI_SCK_PIN A5
# define SPI_MISO_PIN A6
# define SPI_MOSI_PIN A7
# define DRIVER_CS_PINS \
{ B9, B8 }
# define SNLED23751_SPI_DIVISOR 16
# define SPI_DRIVER SPID1
/* Scan phase of led driver set as MSKPHASE_9CHANNEL(defined as 0x03 in snled27351.h) */ /* Scan phase of led driver set as MSKPHASE_9CHANNEL(defined as 0x03 in snled27351.h) */
# define SNLED27351_PHASE_CHANNEL MSKPHASE_9CHANNEL # define SNLED27351_PHASE_CHANNEL MSKPHASE_9CHANNEL
/* Set LED driver current */ /* Set LED driver current */
# define SNLED27351_CURRENT_TUNE \ # define SNLED27351_CURRENT_TUNE \
{ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 } { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }
/* Set to infinit, which is use in USB mode by default */ /* Set to infinit, which is use in USB mode by default */
# define RGB_MATRIX_TIMEOUT RGB_MATRIX_TIMEOUT_INFINITE # define RGB_MATRIX_TIMEOUT RGB_MATRIX_TIMEOUT_INFINITE
/* Allow shutdown of led driver to save power */ /* Allow shutdown of led driver to save power */
# define RGB_MATRIX_DRIVER_SHUTDOWN_ENABLE # define RGB_MATRIX_DRIVER_SHUTDOWN_ENABLE
/* Turn off backlight on low brightness to save power */ /* Turn off backlight on low brightness to save power */

View file

@ -20,7 +20,21 @@
#define ENCODER_DEFAULT_POS 0x3 #define ENCODER_DEFAULT_POS 0x3
#define ENCODER_MAP_KEY_DELAY 2 #define ENCODER_MAP_KEY_DELAY 2
#if defined(RGB_MATRIX_ENABLE) || defined(LK_WIRELESS_ENABLE)
/* SPI configuration */
# define SPI_DRIVER SPID1
# define SPI_SCK_PIN A5
# define SPI_MISO_PIN A6
# define SPI_MOSI_PIN A7
#endif
#if defined(RGB_MATRIX_ENABLE)
# define DRIVER_COUNT 2
# define DRIVER_CS_PINS \
{ B8, B9 }
# define LED_DRIVER_SHUTDOWN_PIN B7 # define LED_DRIVER_SHUTDOWN_PIN B7
# define SNLED23751_SPI_DIVISOR 16
#endif
#ifdef LK_WIRELESS_ENABLE #ifdef LK_WIRELESS_ENABLE
/* Hardware configuration */ /* Hardware configuration */
@ -65,12 +79,6 @@
/* Enable bluetooth NKRO */ /* Enable bluetooth NKRO */
# define WIRELESS_NKRO_ENABLE # define WIRELESS_NKRO_ENABLE
/* Raw hid command for factory test and bluetooth DFU */
# define RAW_HID_CMD 0xAA ... 0xAB
#else
/* Raw hid command for factory test */
# define RAW_HID_CMD 0xAB
#endif #endif
/* Factory test keys */ /* Factory test keys */

View file

@ -1,4 +1,4 @@
/* Copyright 2023 @ Lemokey (https://www.lemokey.com) /* Copyright 2023 ~ 2024 @ Lemokey (https://www.lemokey.com)
* *
* This program is free software : you can redistribute it and /or modify * 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 * it under the terms of the GNU General Public License as published by

View file

@ -1,4 +1,4 @@
/* Copyright 2023 @ Lemokey (https://www.lemokey.com) /* Copyright 2023 ~ 2024 @ Lemokey (https://www.lemokey.com)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -16,37 +16,31 @@
#pragma once #pragma once
#define VIA_FIRMWARE_VERSION 0x00000001
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
/* RGB Matrix driver configuration */ /* RGB Matrix driver configuration */
# define DRIVER_COUNT 2
# define DRIVER_1_LED_COUNT 47 # define DRIVER_1_LED_COUNT 47
# define DRIVER_2_LED_COUNT 44 # define DRIVER_2_LED_COUNT 44
# define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_COUNT + DRIVER_2_LED_COUNT) # define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_COUNT + DRIVER_2_LED_COUNT)
# define SPI_SCK_PIN A5
# define SPI_MISO_PIN A6
# define SPI_MOSI_PIN A7
# define DRIVER_CS_PINS \
{ B8, B9 }
# define SNLED23751_SPI_DIVISOR 16
# define SPI_DRIVER SPID1
/* Scan phase of led driver set as MSKPHASE_9CHANNEL(defined as 0x03 in snled27351.h) */ /* Scan phase of led driver set as MSKPHASE_9CHANNEL(defined as 0x03 in snled27351.h) */
# define SNLED27351_PHASE_CHANNEL MSKPHASE_9CHANNEL # define SNLED27351_PHASE_CHANNEL MSKPHASE_9CHANNEL
/* Set LED driver current */ /* Set LED driver current */
# define SNLED27351_CURRENT_TUNE \ # define SNLED27351_CURRENT_TUNE \
{ 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C } { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }
/* Set to infinit, which is use in USB mode by default */ /* Set to infinit, which is use in USB mode by default */
# define RGB_MATRIX_TIMEOUT RGB_MATRIX_TIMEOUT_INFINITE # define RGB_MATRIX_TIMEOUT RGB_MATRIX_TIMEOUT_INFINITE
/* Allow shutdown of led driver to save power */ /* Allow shutdown of led driver to save power */
# define RGB_MATRIX_DRIVER_SHUTDOWN_ENABLE # define RGB_MATRIX_DRIVER_SHUTDOWN_ENABLE
/* Turn off backlight on low brightness to save power */ /* Turn off backlight on low brightness to save power */
# define RGB_MATRIX_BRIGHTNESS_TURN_OFF_VAL 32 # define RGB_MATRIX_BRIGHTNESS_TURN_OFF_VAL 32
/* Indications */
# define WINLOCK_LED_LIST \
{ 81 }
# define RGB_MATRIX_KEYPRESSES # define RGB_MATRIX_KEYPRESSES
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS # define RGB_MATRIX_FRAMEBUFFER_EFFECTS

View file

@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, BT_HST1, BT_HST2, BT_HST3, P2P4G, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BT_HST1, BT_HST2, BT_HST3, P2P4G, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BAT_LVL, _______, _______, _______, _______, _______, _______, _______,
_______, _______, GUI_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______), _______, _______, GUI_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______),
}; };
// clang-format on // clang-format on

View file

@ -33,12 +33,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MC_1, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, MC_1, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
MC_2, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MC_2, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
MC_3, KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(FN), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), MC_3, KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, KC_RALT, MO(FN), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
[FN] = LAYOUT_ansi_tkl( [FN] = LAYOUT_ansi_tkl(
RGB_TOG, _______, KC_BRID, KC_BRIU, KC_TASK, KC_FILE, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, RGB_TOG, _______, KC_BRID, KC_BRIU, KC_TASK, KC_FILE, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______,
_______, BT_HST1, BT_HST2, BT_HST3, P2P4G, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BT_HST1, BT_HST2, BT_HST3, P2P4G, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BAT_LVL, _______, _______, _______, _______, _______, _______, _______,
_______, _______, GUI_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______), _______, _______, GUI_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______),
}; };

View file

@ -1,4 +1,4 @@
/* Copyright 2023 @ Lemokey (https://www.lemokey.com) /* Copyright 2023 ~ 2024 @ Lemokey (https://www.lemokey.com)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -20,9 +20,21 @@
#define ENCODER_DEFAULT_POS 0x3 #define ENCODER_DEFAULT_POS 0x3
#define ENCODER_MAP_KEY_DELAY 2 #define ENCODER_MAP_KEY_DELAY 2
/* Caps lock LED */ #if defined(RGB_MATRIX_ENABLE) || defined(LK_WIRELESS_ENABLE)
#define LED_CAPS_LOCK_PIN A13 /* SPI configuration */
#define LED_PIN_ON_STATE 1 # define SPI_DRIVER SPID1
# define SPI_SCK_PIN A5
# define SPI_MISO_PIN A6
# define SPI_MOSI_PIN A7
#endif
#if defined(RGB_MATRIX_ENABLE)
# define DRIVER_COUNT 2
# define DRIVER_CS_PINS \
{ B8, B9 }
# define LED_DRIVER_SHUTDOWN_PIN B7
# define SNLED23751_SPI_DIVISOR 16
#endif
#ifdef LK_WIRELESS_ENABLE #ifdef LK_WIRELESS_ENABLE
/* Hardware configuration */ /* Hardware configuration */
@ -41,19 +53,14 @@
# define BT_HOST_DEVICES_COUNT 3 # define BT_HOST_DEVICES_COUNT 3
# define BT_HOST_LED_PIN_LIST \ # define BT_INDICATION_LED_PIN_LIST \
{ C9, C9, C9 } { C9, C9, C9 }
# define HOST_LED_PIN_ON_STATE 0 # define BT_INDICATION_LED_ON_STATE 0
# define P24G_HOST_DEVICES_COUNT 1 # define P24G_INDICATION_LED_PIN A8
# define P24G_HOST_LED_PIN_LIST \
{ A8 }
# if defined(RGB_MATRIX_ENABLE) || defined(LED_MATRIX_ENABLE) # if defined(RGB_MATRIX_ENABLE) || defined(LED_MATRIX_ENABLE)
# define LED_DRIVER_SHUTDOWN_PIN B7
# define BT_INDICATION_LED_LIST \ # define BT_INDICATION_LED_LIST \
{ 17, 18, 19 } { 17, 18, 19 }
@ -78,12 +85,6 @@
/* Enable bluetooth NKRO */ /* Enable bluetooth NKRO */
# define WIRELESS_NKRO_ENABLE # define WIRELESS_NKRO_ENABLE
/* Raw hid command for factory test and bluetooth DFU */
# define RAW_HID_CMD 0xAA ... 0xAB
#else
/* Raw hid command for factory test */
# define RAW_HID_CMD 0xAB
#endif #endif
/* Factory test keys */ /* Factory test keys */

View file

@ -33,6 +33,10 @@
} }
] ]
}, },
"indicators": {
"caps_lock": "A13",
"on_state": 1
},
"rgb_matrix": { "rgb_matrix": {
"driver": "snled27351_spi", "driver": "snled27351_spi",
"sleep": true, "sleep": true,

View file

@ -1,4 +1,4 @@
/* Copyright 2023 @ Lemokey (https://www.lemokey.com) /* Copyright 2023 ~ 2024 @ Lemokey (https://www.lemokey.com)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -18,35 +18,27 @@
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
/* RGB Matrix driver configuration */ /* RGB Matrix driver configuration */
# define DRIVER_COUNT 2
# define DRIVER_1_LED_COUNT 47 # define DRIVER_1_LED_COUNT 47
# define DRIVER_2_LED_COUNT 45 # define DRIVER_2_LED_COUNT 45
# define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_COUNT + DRIVER_2_LED_COUNT) # define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_COUNT + DRIVER_2_LED_COUNT)
# define SPI_SCK_PIN A5
# define SPI_MISO_PIN A6
# define SPI_MOSI_PIN A7
# define DRIVER_CS_PINS \
{ B8, B9 }
# define SNLED23751_SPI_DIVISOR 16
# define SPI_DRIVER SPID1
/* Scan phase of led driver set as MSKPHASE_9CHANNEL(defined as 0x03 in snled27351.h) */ /* Scan phase of led driver set as MSKPHASE_9CHANNEL(defined as 0x03 in snled27351.h) */
# define PHASE_CHANNEL MSKPHASE_9CHANNEL # define PHASE_CHANNEL MSKPHASE_9CHANNEL
/* Set LED driver current */ /* Set LED driver current */
# define SNLED27351_CURRENT_TUNE \ # define SNLED27351_CURRENT_TUNE \
{ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 } { 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24 }
/* Set to infinit, which is use in USB mode by default */ /* Set to infinit, which is use in USB mode by default */
# define RGB_MATRIX_TIMEOUT RGB_MATRIX_TIMEOUT_INFINITE # define RGB_MATRIX_TIMEOUT RGB_MATRIX_TIMEOUT_INFINITE
/* Allow shutdown of led driver to save power */ /* Allow shutdown of led driver to save power */
# define RGB_MATRIX_DRIVER_SHUTDOWN_ENABLE # define RGB_MATRIX_DRIVER_SHUTDOWN_ENABLE
/* Turn off backlight on low brightness to save power */ /* Turn off backlight on low brightness to save power */
# define RGB_MATRIX_BRIGHTNESS_TURN_OFF_VAL 32 # define RGB_MATRIX_BRIGHTNESS_TURN_OFF_VAL 32
/* Indications */
# define WINLOCK_LED_LIST \
{ 82 }
# define RGB_MATRIX_KEYPRESSES # define RGB_MATRIX_KEYPRESSES
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS # define RGB_MATRIX_FRAMEBUFFER_EFFECTS

View file

@ -1,4 +1,4 @@
/* Copyright 2023 @ Lemokey (https://www.lemokey.com) /* Copyright 2023 ~ 2024 @ Lemokey (https://www.lemokey.com)
* *
* This program is free software : you can redistribute it and /or modify * 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 * it under the terms of the GNU General Public License as published by

View file

@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, BT_HST1, BT_HST2, BT_HST3, P2P4G, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BT_HST1, BT_HST2, BT_HST3, P2P4G, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BAT_LVL, _______, _______, _______, _______, _______, _______, _______,
_______, _______, GUI_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______), _______, _______, GUI_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______),
}; };
// clang-format on // clang-format on

View file

@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, BT_HST1, BT_HST2, BT_HST3, P2P4G, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BT_HST1, BT_HST2, BT_HST3, P2P4G, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, BAT_LVL, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BAT_LVL, _______, _______, _______, _______, _______, _______, _______,
_______, _______, GUI_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______), _______, _______, GUI_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______),
}; };
// clang-format on // clang-format on

View file

@ -1,4 +1,4 @@
/* Copyright 2023 @ Lemokey (https://www.lemokey.com) /* Copyright 2023 ~ 2024 @ Lemokey (https://www.lemokey.com)
* *
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -32,8 +32,7 @@
static uint32_t power_on_indicator_timer_buffer; static uint32_t power_on_indicator_timer_buffer;
#ifdef LK_WIRELESS_ENABLE #ifdef LK_WIRELESS_ENABLE
pin_t bt_led_pins[] = BT_HOST_LED_PIN_LIST; pin_t bt_led_pins[] = BT_INDICATION_LED_PIN_LIST;
pin_t p24g_led_pins[] = P24G_HOST_LED_PIN_LIST;
#endif #endif
bool process_record_lemokey_kb(uint16_t keycode, keyrecord_t *record) { bool process_record_lemokey_kb(uint16_t keycode, keyrecord_t *record) {
@ -69,9 +68,8 @@ bool lemokey_task_kb(void) {
#ifdef LK_WIRELESS_ENABLE #ifdef LK_WIRELESS_ENABLE
writePin(BAT_LOW_LED_PIN, !BAT_LOW_LED_PIN_ON_STATE); writePin(BAT_LOW_LED_PIN, !BAT_LOW_LED_PIN_ON_STATE);
for (uint8_t i = 0; i < sizeof(bt_led_pins) / sizeof(pin_t); i++) for (uint8_t i = 0; i < sizeof(bt_led_pins) / sizeof(pin_t); i++)
writePin(bt_led_pins[i], 1); writePin(bt_led_pins[i], !BT_INDICATION_LED_ON_STATE);
for (uint8_t i = 0; i < sizeof(p24g_led_pins) / sizeof(pin_t); i++) writePin(P24G_INDICATION_LED_PIN, !BT_INDICATION_LED_ON_STATE);
writePin(p24g_led_pins[i], 1);
#endif #endif
} else { } else {
@ -80,10 +78,9 @@ bool lemokey_task_kb(void) {
writePin(BAT_LOW_LED_PIN, BAT_LOW_LED_PIN_ON_STATE); writePin(BAT_LOW_LED_PIN, BAT_LOW_LED_PIN_ON_STATE);
if (get_transport() != TRANSPORT_P2P4) if (get_transport() != TRANSPORT_P2P4)
for (uint8_t i = 0; i < sizeof(bt_led_pins) / sizeof(pin_t); i++) for (uint8_t i = 0; i < sizeof(bt_led_pins) / sizeof(pin_t); i++)
writePin(bt_led_pins[i], 0); writePin(bt_led_pins[i], BT_INDICATION_LED_ON_STATE);
if (get_transport() != TRANSPORT_BLUETOOTH) if (get_transport() != TRANSPORT_BLUETOOTH)
for (uint8_t i = 0; i < sizeof(p24g_led_pins) / sizeof(pin_t); i++) writePin(P24G_INDICATION_LED_PIN, BT_INDICATION_LED_ON_STATE);
writePin(p24g_led_pins[i], 0);
#endif #endif
} }