Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/PageRTC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ struct PageRTC : public PageBase
if (_slide_x == 206)
{
int timer = _wake_timer.hours * 3600 + _wake_timer.minutes * 60 + _wake_timer.seconds;
prepareForPowerDown();
M5.Power.timerSleep(timer);
}
else
Expand Down
14 changes: 11 additions & 3 deletions src/PageTF.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,26 @@ struct PageTF : public PageBase
private:
bool showFiles(File dir)
{
File fp = dir.openNextFile();
bool abort = false;
while ((bool)(fp = dir.openNextFile()))
while (true)
{
File fp = dir.openNextFile();
if (!fp) { break; }

updateTouch();
abort = (prev_touchPoints < touchPoints);
if (abort) break;
if (abort)
{
fp.close();
break;
}
M5.Lcd.print(fp.name());
if (fp.isDirectory())
{
M5.Lcd.println("/");
if (!showFiles(fp))
{
fp.close();
abort = true;
break;
}
Expand All @@ -108,6 +115,7 @@ struct PageTF : public PageBase
{
M5.Lcd.println();
}
fp.close();
}
dir.rewindDirectory();
return !abort;
Expand Down
8 changes: 8 additions & 0 deletions src/main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ static void buzzerFlush(void)

#endif

static void prepareForPowerDown(void)
{
#if M5TOOLS_TARGET_ESP32C5
buzzerStop();
M5.Power.M5pm1.setLedEnLevel(false);
#endif
}

void clickSound(void)
{
#if M5TOOLS_TARGET_ESP32C5
Expand Down
1 change: 1 addition & 0 deletions src/src.ino
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ Serial.print("done");
#if M5TOOLS_TARGET_ESP32C5
/// wakeup ピン (PM1 の IRQ 出力) の解放待ちを含む M5Unified 側の
/// 手順に任せる (タッチ・電源ボタン・RTC アラームのいずれでも復帰可能)
prepareForPowerDown();
delay(100);
M5.Lcd.fillScreen(TFT_BLACK);
M5.Power.deepSleep(m5::Power_Class::sleep_no_timer, true);
Expand Down