Skip to content

Commit 64d143d

Browse files
committed
Update components and add latest coprocessor firmware
1 parent fc8d95a commit 64d143d

4 files changed

Lines changed: 33 additions & 30 deletions

File tree

main/coprocessor_management.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static void callback(char const* status_text, uint8_t percentage) {
3333
}
3434

3535
void coprocessor_flash(bool force) {
36-
uint16_t coprocessor_firmware_target = 6;
36+
uint16_t coprocessor_firmware_target = 5;
3737

3838
tanmatsu_coprocessor_handle_t coprocessor_handle = NULL;
3939

main/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ dependencies:
22
idf:
33
version: ">=5.5.0"
44
badgeteam/badge-bsp:
5-
version: ">=0.5.0"
5+
version: ">=0.5.1"
66
robotman2412/pax-gfx:
77
version: ">=2.0.4"
88
badgeteam/appfs:

main/menu/message_dialog.c

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -106,37 +106,40 @@ static gui_element_icontext_t wifi_indicator(void) {
106106
wifi_mode_t mode = WIFI_MODE_NULL;
107107
bsp_radio_state_t state;
108108
bsp_power_get_radio_state(&state);
109-
if (state == BSP_POWER_RADIO_STATE_OFF) {
110-
return (gui_element_icontext_t){get_icon(ICON_WIFI), "OFF"};
111-
}
112-
if (state == BSP_POWER_RADIO_STATE_BOOTLOADER) {
113-
return (gui_element_icontext_t){get_icon(ICON_WIFI), "BOOTLOADER"};
114-
}
115-
if (radio_initialized && esp_wifi_get_mode(&mode) == ESP_OK) {
116-
if (mode == WIFI_MODE_STA || mode == WIFI_MODE_APSTA) {
117-
if (wifi_connection_is_connected() && esp_wifi_sta_get_ap_info(&connected_ap) == ESP_OK) {
118-
pax_buf_t* icon = get_icon(ICON_WIFI_0);
119-
if (connected_ap.rssi > -50) {
120-
icon = get_icon(ICON_WIFI_4);
121-
} else if (connected_ap.rssi > -60) {
122-
icon = get_icon(ICON_WIFI_3);
123-
} else if (connected_ap.rssi > -70) {
124-
icon = get_icon(ICON_WIFI_2);
125-
} else if (connected_ap.rssi > -80) {
126-
icon = get_icon(ICON_WIFI_1);
109+
switch (state) {
110+
case BSP_POWER_RADIO_STATE_OFF:
111+
return (gui_element_icontext_t){NULL, ""};
112+
case BSP_POWER_RADIO_STATE_BOOTLOADER:
113+
return (gui_element_icontext_t){NULL, "BOOT"};
114+
case BSP_POWER_RADIO_STATE_APPLICATION:
115+
default:
116+
if (radio_initialized && esp_wifi_get_mode(&mode) == ESP_OK) {
117+
if (mode == WIFI_MODE_STA || mode == WIFI_MODE_APSTA) {
118+
if (wifi_connection_is_connected() && esp_wifi_sta_get_ap_info(&connected_ap) == ESP_OK) {
119+
pax_buf_t* icon = get_icon(ICON_WIFI_0);
120+
if (connected_ap.rssi > -50) {
121+
icon = get_icon(ICON_WIFI_4);
122+
} else if (connected_ap.rssi > -60) {
123+
icon = get_icon(ICON_WIFI_3);
124+
} else if (connected_ap.rssi > -70) {
125+
icon = get_icon(ICON_WIFI_2);
126+
} else if (connected_ap.rssi > -80) {
127+
icon = get_icon(ICON_WIFI_1);
128+
}
129+
return (gui_element_icontext_t){icon, (char*)connected_ap.ssid};
130+
} else {
131+
return (gui_element_icontext_t){get_icon(ICON_WIFI_OFF), "Disconnected"};
132+
}
133+
} else if (mode == WIFI_MODE_AP) {
134+
return (gui_element_icontext_t){get_icon(ICON_WIFI_OFF), ""}; // AP mode is currently unused
135+
// The device will be in AP mode by default until connection to a network is
136+
} else {
137+
return (gui_element_icontext_t){get_icon(ICON_WIFI_UNKNOWN), "Other"};
127138
}
128-
return (gui_element_icontext_t){icon, (char*)connected_ap.ssid};
129139
} else {
130-
return (gui_element_icontext_t){get_icon(ICON_WIFI_OFF), "Disconnected"};
140+
return (gui_element_icontext_t){get_icon(ICON_WIFI_ERROR), ""};
131141
}
132-
} else if (mode == WIFI_MODE_AP) {
133-
return (gui_element_icontext_t){get_icon(ICON_WIFI_OFF), ""}; // AP mode is currently unused
134-
// The device will be in AP mode by default until connection to a network is
135-
} else {
136-
return (gui_element_icontext_t){get_icon(ICON_WIFI_UNKNOWN), "Other"};
137-
}
138-
} else {
139-
return (gui_element_icontext_t){get_icon(ICON_WIFI_ERROR), ""};
142+
break;
140143
}
141144
}
142145

main/tanmatsu_coprocessor.bin

44 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)