style: update LED macro

This commit is contained in:
Roy_01
2025-07-17 16:27:23 +08:00
parent e6091b811e
commit 7cf17ad98d
5 changed files with 17 additions and 17 deletions
+8 -8
View File
@@ -73,14 +73,14 @@ extern "C"
(struct led_color) { .R = 1, .G = 0, .B = 1 }
#endif
#define LED_OFF LED_NONE
#define LED_ON LED_GREEN
#define LED_ERROR LED_RED
#define LED_IDEL_DISCONNECT LED_YELLOW
#define LED_IDEL_CONNECTED LED_GREEN
#define LED_REC LED_CYAN
#define LED_IDENTICY_DEV LED_PURPLE
#define LED_BUTTON_PRESS LED_YELLOW
#define LED_OFF LED_NONE
#define LED_ON LED_GREEN
#define LED_ERROR LED_RED
#define LED_IDLE_DISCONNECTED LED_YELLOW
#define LED_IDLE_CONNECTED LED_GREEN
#define LED_REC LED_CYAN
#define LED_IDENTIFY_DEV LED_PURPLE
#define LED_BUTTON_PRESS LED_YELLOW
#if (DEF_LED_DRV_ENABLED)
int32_t led_init(void);
+4 -4
View File
@@ -123,7 +123,7 @@ static void btn_event_shortx2_cb(void)
led_set(LED_BLUE);
vTaskDelay(pdMS_TO_TICKS(250));
}
led_set(LED_IDEL_DISCONNECT);
led_set(LED_IDLE_DISCONNECTED);
}
static void btn_event_shortx3_cb(void)
@@ -135,9 +135,9 @@ static void btn_event_shortx3_cb(void)
vTaskDelay(pdMS_TO_TICKS(250));
led_set(LED_CYAN);
vTaskDelay(pdMS_TO_TICKS(250));
led_set(LED_IDEL_DISCONNECT);
led_set(LED_IDLE_DISCONNECTED);
}
led_set(LED_IDEL_DISCONNECT);
led_set(LED_IDLE_DISCONNECTED);
}
static void btn_event_long(void)
@@ -153,7 +153,7 @@ static void btn_event_long(void)
led_set(LED_OFF);
elite_board_power_off();
}
led_set(LED_IDEL_DISCONNECT);
led_set(LED_IDLE_DISCONNECTED);
}
static void btn_task(void *pvArg)
+2 -2
View File
@@ -920,13 +920,13 @@ static void vis_int(uint8_t *ins, uint16_t size) { NRF_LOG_INFO("%s", __FUNCTION
static void vis_device_shiny(uint8_t *ins, uint16_t size)
{
NRF_LOG_INFO("%s", __FUNCTION__);
led_set(LED_IDENTICY_DEV);
led_set(LED_IDENTIFY_DEV);
}
static void vis_shiny_dis(uint8_t *ins, uint16_t size)
{
NRF_LOG_INFO("%s", __FUNCTION__);
led_set(LED_IDEL_CONNECTED);
led_set(LED_IDLE_CONNECTED);
}
static void curve_iv(uint8_t *ins, uint16_t size) { NRF_LOG_INFO("%s", __FUNCTION__); }
+1 -1
View File
@@ -46,7 +46,7 @@ void elite_drv_init(void)
{
btn_init();
led_init();
led_set(LED_IDEL_DISCONNECT);
led_set(LED_IDLE_DISCONNECTED);
sw_init();
adc_init();
dac_init();
+2 -2
View File
@@ -42,13 +42,13 @@ static void le_evt_handler(ble_evt_t const *p_ble_evt, void *p_context)
NRF_LOG_INFO("Connect to peer.");
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_CONN, p_ble_evt->evt.gap_evt.conn_handle, 8);
APP_ERROR_CHECK(err_code);
led_set(LED_IDEL_CONNECTED);
led_set(LED_IDLE_CONNECTED);
break;
case BLE_GAP_EVT_DISCONNECTED:
NRF_LOG_INFO("Disconnect from peer.");
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, p_ble_evt->evt.gap_evt.conn_handle, 0);
APP_ERROR_CHECK(err_code);
led_set(LED_IDEL_DISCONNECT);
led_set(LED_IDLE_DISCONNECTED);
break;
case BLE_GAP_EVT_PHY_UPDATE_REQUEST: {
NRF_LOG_INFO("PHY update response. (AUTO)");