Skip to content

Commit

Permalink
Added 5 second delay for showing OK button on physio rotate screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Dakkaron committed Feb 22, 2025
1 parent b0593d8 commit 3d59c84
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
1 change: 0 additions & 1 deletion T-HMI-PEPmonitor/src/hardware/gfxHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,6 @@ void drawSystemStats(uint32_t ms, uint32_t lastMs) {
loadBmp(&batteryIcon[1], "/gfx/battery_half.bmp");
loadBmp(&batteryIcon[2], "/gfx/battery_full.bmp");
}
spr.drawRect(0, 0, 70, 20, 0x0000);
if (batteryVoltage < 3600) {
batteryIcon[0].pushToSprite(&spr, 1, 1, 0x0000);
} else if (batteryVoltage < 3800) {
Expand Down
23 changes: 20 additions & 3 deletions T-HMI-PEPmonitor/src/physioProtocolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ static void drawFinished() {
if (systemConfig.logExecutions) {
handleLogExecutions();
}
spr.frameBuffer(1);
spr.fillSprite(TFT_BLACK);
spr.frameBuffer(2);
spr.fillSprite(TFT_BLACK);
tft.fillRect(32,0,38,20,TFT_BLACK);
drawBmp(winScreenPath, 0, 0);
} else if (millis() > winscreenTimeout) {
Expand All @@ -271,11 +275,24 @@ void displayPhysioRotateScreen() {
drawBmp(profileData.taskChangeImagePath[currentTask], 0, 0);
spr.setTextDatum(TL_DATUM);
spr.drawString(profileData.taskChangeMessage[currentTask], 5, 5);
spr.fillRect(230, 170, 80, 60, 0x18db);
spr.drawString("OK", 245, 185);
spr.pushSpriteFast(0, 0);
uint32_t displayOkButtonMs = millis() + 5000;

while (!isTouchInZone(230, 170, 80, 60)) {}
while (!isTouchInZone(230, 170, 80, 60)) {
if (displayOkButtonMs!=0 && millis() > displayOkButtonMs) {
spr.fillSprite(TFT_BLACK);
spr.pushSpriteFast(0, 0);
spr.fillSprite(TFT_BLACK);
spr.setTextSize(4);
drawBmp(profileData.taskChangeImagePath[currentTask], 0, 0);
spr.setTextDatum(TL_DATUM);
spr.drawString(profileData.taskChangeMessage[currentTask], 5, 5);
spr.fillRect(230, 170, 80, 60, 0x18db);
spr.drawString("OK", 245, 185);
spr.pushSpriteFast(0, 0);
displayOkButtonMs = 0;
}
}

tft.fillScreen(TFT_BLACK);
spr.fillScreen(TFT_BLACK);
Expand Down
4 changes: 3 additions & 1 deletion T-HMI-PEPmonitor/src/updateHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ static void fetchReleaseUrl() {
Serial.println("Checking for firmware update");
String ignoreMessage;
String url = downloadFileToString(FIRMWARE_RELEASE_PATH_URL, &ignoreMessage);
Serial.println("Update URL: "+url);
if (ignoreMessage.length() > 0) {
Serial.println("Error checking for firmware update: "+ignoreMessage);
systemUpdateWasChecked = true;
return;
}
String lastUrl = "";
String lastUrl = "none";
if (SD_MMC.exists(LAST_RELEASE_URL_FILE_PATH)) {
lastUrl = readFileToString(LAST_RELEASE_URL_FILE_PATH);
}
Serial.println("Last URL: "+lastUrl);
systemUpdateReleaseUrl = url.equals(lastUrl) ? "" : url;
systemUpdateWasChecked = true;
Serial.println("Result: "+systemUpdateReleaseUrl);
Expand Down
2 changes: 1 addition & 1 deletion path_to_latest_release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/Dakkaron/T-HMI-PEPmonitor/releases/download/v1.1/
https://github.com/Dakkaron/T-HMI-PEPmonitor/releases/download/v1.2/

0 comments on commit 3d59c84

Please sign in to comment.