add second line for longer pool url, switch to fallback if used

This commit is contained in:
WantClue 2024-10-09 20:58:14 +02:00
parent bbef32f1c1
commit 4010a0bece

View File

@ -409,9 +409,20 @@ static void _update_screen_two(GlobalState * GLOBAL_STATE)
if (OLED_status()) {
// Pool URL
memset(module->oled_buf, 0, 20);
snprintf(module->oled_buf, 20, "Pool: %.13s", module->pool_url);
if (module->is_using_fallback) {
snprintf(module->oled_buf, 20, "Pool: %.13s", module->fallback_pool_url);
} else {
snprintf(module->oled_buf, 20, "Pool: %.13s", module->pool_url);
}
OLED_writeString(0, 0, module->oled_buf);
// Second line of pool URL
memset(module->oled_buf, 0, 20);
if (module->is_using_fallback) {
snprintf(module->oled_buf, 20, "%.19s", module->fallback_pool_url + 13);
} else {
snprintf(module->oled_buf, 20, "%.19s", module->pool_url + 13);
}
OLED_writeString(0, 1, module->oled_buf);
// IP Address
esp_netif_get_ip_info(netif, &ip_info);