| 955 | } |
| 956 | |
| 957 | void drawBatteryStatus(uint8_t bat) { |
| 958 | if (bat == 0) return; |
| 959 | |
| 960 | bool charging = isCharging(); |
| 961 | |
| 962 | uint16_t color = bruceConfig.priColor; |
| 963 | uint16_t barcolor = bruceConfig.priColor; |
| 964 | if (bat < 16) barcolor = color = TFT_RED; |
| 965 | |
| 966 | tft.drawRoundRect(tftWidth - 42, 7, 34, 17, 2, color); |
| 967 | tft.setTextSize(FP); |
| 968 | tft.fillRect(tftWidth - 85, 7, 42, 18, bruceConfig.bgColor); |
| 969 | if (charging) { |
| 970 | tft.setTextColor(bruceConfig.priColor, bruceConfig.bgColor); |
| 971 | tft.drawRightString("CHG", tftWidth - 44, 12, 1); |
| 972 | } else { |
| 973 | tft.setTextColor(bruceConfig.priColor, bruceConfig.bgColor); |
| 974 | tft.drawRightString((bat == 100 ? "" : " ") + String(bat) + "%", tftWidth - 44, 12, 1); |
| 975 | } |
| 976 | tft.fillRoundRect(tftWidth - 40, 9, 30 * bat / 100, 13, 2, barcolor); |
| 977 | tft.drawLine(tftWidth - 30, 9, tftWidth - 30, 9 + 13, bruceConfig.bgColor); |
| 978 | tft.drawLine(tftWidth - 20, 9, tftWidth - 20, 9 + 13, bruceConfig.bgColor); |
| 979 | } |
| 980 | |
| 981 | void drawWireguardStatus(int x, int y) { |
| 982 | tft.fillRect(x, y, 16, 16, bruceConfig.bgColor); |
no test coverage detected