@@ -1949,8 +1949,8 @@ class header_ui_t : public ui_base_t {
19491949 param->battery_state == m5::Power_Class::is_charging;
19501950 const bool unknown =
19511951 param->battery_state == m5::Power_Class::charge_unknown;
1952- const uint32_t color = charging ? 0x00FF00u
1953- : (unknown ? 0x808080u : 0xFFFFFFu );
1952+ const uint32_t color =
1953+ charging ? 0x00FF00u : (unknown ? 0x808080u : 0xFFFFFFu );
19541954 canvas->drawRect (xpos, y, 14 , 10 , color);
19551955 canvas->fillRect (xpos + 14 , y + 3 , 2 , 4 , color);
19561956 if (param->battery_level >= 0 ) {
@@ -2015,14 +2015,15 @@ class header_ui_t : public ui_base_t {
20152015 snprintf (countdown, sizeof (countdown), " %u" ,
20162016 unsigned (param->cloud_countdown_sec ));
20172017 const lgfx::IFont* font = &fonts::Font2;
2018- if (canvas->textWidth (countdown, font) > xpos - _client_rect.x ) {
2018+ if (canvas->textWidth (countdown, font) >
2019+ xpos - _client_rect.x ) {
20192020 font = &fonts::Font0;
20202021 }
20212022 // Narrow layouts prioritize the three status icons.
2022- if (canvas->textWidth (countdown, font) <= xpos - _client_rect. x ) {
2023- xpos -= canvas-> drawString (countdown, xpos,
2024- _client_rect. y - canvas_y,
2025- font);
2023+ if (canvas->textWidth (countdown, font) <=
2024+ xpos - _client_rect. x ) {
2025+ xpos -= canvas-> drawString (
2026+ countdown, xpos, _client_rect. y - canvas_y, font);
20262027 }
20272028 }
20282029 }
@@ -2244,7 +2245,7 @@ class image_ui_t : public ui_base_t {
22442245 param->range_temp_lower )
22452246 << 8 ) /
22462247 param->temp_diff ;
2247- v3 = (v3 < 0 ) ? 0 : (v3 > 255 ) ? 255 : v3;
2248+ v3 = (v3 < 0 ) ? 0 : (v3 > 255 ) ? 255 : v3;
22482249 int32_t x1 = 0 ;
22492250 for (int32_t fx = 1 ; fx < frame_width; ++fx) {
22502251 int32_t x0 = x1;
@@ -2280,7 +2281,7 @@ class image_ui_t : public ui_base_t {
22802281 canvas->getBuffer ())[_client_rect.x + x0 +
22812282 ypos * canvas->width ()];
22822283 for (int32_t bx = 0 ; bx < boxWidth; ++bx) {
2283- uint32_t v = (v02 * (boxWidth - bx) + v13 * bx) >> 16 ;
2284+ uint32_t v = (v02 * (boxWidth - bx) + v13 * bx) >> 16 ;
22842285 img_buf[bx] = m5gfx::getSwap16 (param->color_map [v]);
22852286 }
22862287 }
@@ -2896,9 +2897,8 @@ uint8_t changeLayout(uint8_t layout_idx) {
28962897}
28972898
28982899void drawTask (void *) {
2899- ui_base_t * ui_list[] = {&text_ui, &hist_ui,
2900- &image_ui, &graph_ui, &config_ui,
2901- &header_ui, &qrcode_ui, &overlay_ui};
2900+ ui_base_t * ui_list[] = {&text_ui, &hist_ui, &image_ui, &graph_ui,
2901+ &config_ui, &header_ui, &qrcode_ui, &overlay_ui};
29022902 static constexpr const uint32_t disp_buf_height = 16 ;
29032903 static constexpr const size_t disp_buf_count =
29042904 3 ; // 描画バッファの数。jpegエンコーダのqueueにセットする分があるため3とする
@@ -3090,8 +3090,8 @@ static void wifiTask(void*) {
30903090 bool rtc_sync = false ;
30913091 config_param_t ::net_setup_mode_t prev_net_setup_mode =
30923092 config_param_t ::net_setup_mode_off;
3093- bool prev_ap_connected = false ;
3094- bool prev_sta_connected = false ;
3093+ bool prev_ap_connected = false ;
3094+ bool prev_sta_connected = false ;
30953095 uint32_t connect_retry_at = millis () + 15000 ;
30963096
30973097 for (;;) {
@@ -3208,13 +3208,12 @@ static void wifiTask(void*) {
32083208
32093209 const bool wifi_requested = (bool )draw_param.request_wifi_state ;
32103210 const bool ap_setup_active =
3211- draw_param.net_setup_mode ==
3212- draw_param.net_setup_mode_accesspoint ;
3211+ draw_param.net_setup_mode == draw_param.net_setup_mode_accesspoint ;
32133212 const bool sta_enabled = WiFi.getMode () & WIFI_MODE_STA ;
32143213 if (!need_wifi_reconnect &&
3215- (wifi_requested ? WiFi. isConnected ()
3216- : (ap_setup_active ? ! WiFi.isConnected ()
3217- : !sta_enabled))) {
3214+ (wifi_requested
3215+ ? WiFi.isConnected ()
3216+ : (ap_setup_active ? !WiFi. isConnected () : !sta_enabled))) {
32183217 continue ;
32193218 }
32203219
@@ -3231,7 +3230,7 @@ static void wifiTask(void*) {
32313230 draw_param.net_setup_mode_off );
32323231 }
32333232 need_wifi_reconnect = false ;
3234- connect_retry_at = millis ();
3233+ connect_retry_at = millis ();
32353234 } else {
32363235 if (int32_t (millis () - connect_retry_at) >= 0 ) {
32373236 if (!draw_param.net_tmp_ssid .empty ()) {
@@ -3584,7 +3583,8 @@ void setup(void) {
35843583
35853584 // DNS host labels cannot contain underscores. Keep the AP SSID unchanged.
35863585 char hostname[32 ];
3587- snprintf (hostname, sizeof (hostname), " t-lite-%02x%02x" , macaddr[4 ], macaddr[5 ]);
3586+ snprintf (hostname, sizeof (hostname), " t-lite-%02x%02x" , macaddr[4 ],
3587+ macaddr[5 ]);
35883588 draw_param.net_hostname = hostname;
35893589
35903590 char cbuf[32 ];
@@ -3608,7 +3608,8 @@ void setup(void) {
36083608 // snprintf(cbuf, sizeof(cbuf), "http://%s/",
36093609 // draw_param.net_apmode_ipaddr.toString().c_str()); draw_param.net_ap_url =
36103610 // cbuf;
3611- draw_param.net_ap_url = " http://" +
3611+ draw_param.net_ap_url =
3612+ " http://" +
36123613 std::string (draw_param.net_apmode_ipaddr .toString ().c_str ()) + " /wifi" ;
36133614
36143615 snprintf (cbuf, sizeof (cbuf), " %02x%02x%02x%02x%02x%02x" , macaddr[0 ],
0 commit comments