diff --git a/skeleton/SYSTEM/tg5040/bin/suspend b/skeleton/SYSTEM/tg5040/bin/suspend index 5b6715a17..00ec97c38 100755 --- a/skeleton/SYSTEM/tg5040/bin/suspend +++ b/skeleton/SYSTEM/tg5040/bin/suspend @@ -1,5 +1,5 @@ #!/bin/sh -# set -eu +set -euo pipefail exec 0<&- # wpa_running=0 diff --git a/workspace/all/common/api.c b/workspace/all/common/api.c index 464c4e35f..0a4ac041f 100644 --- a/workspace/all/common/api.c +++ b/workspace/all/common/api.c @@ -2872,16 +2872,21 @@ static void PWR_waitForWake(void) { if(sleepDelay > 0) { SDL_Delay(200); if (SDL_GetTicks()-sleep_ticks>=sleepDelay) { // increased to two minutes - // if (pwr.is_charging) { - // sleep_ticks += 60000; // check again in a minute - // continue; - // } + if (pwr.is_charging) { + sleep_ticks += 60000; // check again in a minute + continue; + } if (PLAT_supportsDeepSleep()) { int ret = PWR_deepSleep(); if (ret == 0) { return; + } else if (deep_sleep_attempts < 3) { + LOG_warn("failed to enter deep sleep - retrying in 5 seconds\n"); + sleep_ticks += 5000; + deep_sleep_attempts++; + continue; } else { - LOG_info("failed to enter deep sleep - powering off\n"); + LOG_warn("failed to enter deep sleep - powering off\n"); } } if (pwr.can_poweroff) { diff --git a/workspace/all/nextui/nextui.c b/workspace/all/nextui/nextui.c index a554f42a7..f60cefef3 100644 --- a/workspace/all/nextui/nextui.c +++ b/workspace/all/nextui/nextui.c @@ -2159,7 +2159,11 @@ int main (int argc, char *argv[]) { int new_w = max_w; int new_h = max_h; had_thumb = 1; - ox = (int)(max_w) - SCALE1(BUTTON_MARGIN*5); + if(exists(thumbpath)) + ox = (int)(max_w) - SCALE1(BUTTON_MARGIN*5); + else + ox = screen->w; + SDL_UnlockMutex(thumbMutex); }