Skip to content

Commit c5d928d

Browse files
committed
t-watch fixes
1 parent 2a8f8b0 commit c5d928d

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

boards/lilygo-t-watch-s3/interface.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#include "powerSave.h"
2+
#include <SPI.h>
23
#include <Wire.h>
34
#include <XPowersLib.h>
5+
#include <driver/gpio.h>
6+
#include <esp_system.h>
47
#include <interface.h>
58

69
XPowersAXP2101 axp192;
@@ -214,3 +217,26 @@ void checkReboot() {}
214217
bool isCharging() {
215218
return axp192.isCharging(); // Return the charging status from AXP
216219
}
220+
221+
void reboot() {
222+
Serial.flush();
223+
224+
ledcWrite(TFT_BL, 0);
225+
digitalWrite(TFT_BL, LOW);
226+
227+
drv.setWaveform(0, 0);
228+
drv.setWaveform(1, 0);
229+
230+
axp192.enableALDO1(); //! RTC VBAT
231+
axp192.enableALDO2(); //! TFT BACKLIGHT VDD
232+
233+
// Force the touch controller to lose power so the next boot starts from a clean state.
234+
axp192.disableALDO3();
235+
axp192.disableBLDO2();
236+
delay(50);
237+
axp192.enableALDO3(); //! Screen touch VDD
238+
axp192.enableBLDO2(); //! drv2605 enable
239+
240+
delay(100);
241+
esp_restart();
242+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x6000,
3+
phy_init, data, phy, 0xf000, 4K,
4+
app0, app, test, 0x10000, 0x1F0000,
5+
app1, app, ota_0, 0x200000, 0x800000,
6+
storage, data, FAT, 0xA00000, 0x200000,
7+
spiffs, data, spiffs, 0xC00000, 0x3D0000,
8+
coredump, data, coredump, 0xFD0000, 0x30000,
9+

0 commit comments

Comments
 (0)