修改亮灯逻辑

This commit is contained in:
OPTOC
2025-08-29 11:09:37 +08:00
parent aa9347e37c
commit 5e9b0a51cb
2 changed files with 15 additions and 7 deletions

View File

@@ -57,7 +57,7 @@ void embedded_thread(void* arg)
}
void pc_link_rgb_color(device_t* device)
{
static uint8_t last_connect = 0, last_wifi_mode = 0;
static uint8_t last_connect = 255, last_wifi_mode = 0;
if(device->connect_pc != last_connect || last_wifi_mode != device->init_device.wifi_mode)
{
switch (device->connect_pc)
@@ -65,9 +65,9 @@ void pc_link_rgb_color(device_t* device)
case DISCONNECT:
{
if(device->init_device.wifi_mode == WIFI_NETIF_MODE_AP)
rgb_color_change(0, RGB_COLOR_BLUE);
rgb_color_change(0, RGB_COLOR_GREEN_WHITE);
else
rgb_color_change(0, RGB_COLOR_ORANGE);
rgb_color_change(0, RGB_COLOR_GREEN_PURPLE);
break;
}
@@ -96,8 +96,12 @@ void pc_link_rgb_color(device_t* device)
last_connect = device->connect_pc;
last_wifi_mode = device->init_device.wifi_mode;
}
if(device->connect_pc){
rgb_update_cyle(0);
if(device->connect_pc == DISCONNECT)
{
rgb_update_cyle(50);
}
else if(device->connect_pc){
rgb_update_cyle(888);
}else{
rgb_update_cyle(500);
}