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
9 changes: 6 additions & 3 deletions src/M5CoreInk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ M5CoreInk::~M5CoreInk()

int M5CoreInk::begin(bool InkEnable, bool wireEnable, bool SpeakerEnable)
{

_inkEnable = InkEnable;

pinMode(POWER_HOLD_PIN, OUTPUT);
digitalWrite(POWER_HOLD_PIN, HIGH); // Hold power

Expand Down Expand Up @@ -62,7 +65,7 @@ void M5CoreInk::shutdown()
}
int M5CoreInk::shutdown(int seconds)
{
M5Ink.deepSleep();
if (_inkEnable) M5Ink.deepSleep();
rtc.clearIRQ();
rtc.SetAlarmIRQ(seconds);
delay(10);
Expand All @@ -71,7 +74,7 @@ int M5CoreInk::shutdown(int seconds)
}
int M5CoreInk::shutdown(const RTC_TimeTypeDef &RTC_TimeStruct)
{
M5Ink.deepSleep();
if (_inkEnable) M5Ink.deepSleep();
rtc.clearIRQ();
rtc.SetAlarmIRQ(RTC_TimeStruct);
delay(10);
Expand All @@ -80,7 +83,7 @@ int M5CoreInk::shutdown(const RTC_TimeTypeDef &RTC_TimeStruct)
}
int M5CoreInk::shutdown(const RTC_DateTypeDef &RTC_DateStruct, const RTC_TimeTypeDef &RTC_TimeStruct)
{
M5Ink.deepSleep();
if (_inkEnable) M5Ink.deepSleep();
rtc.clearIRQ();
rtc.SetAlarmIRQ(RTC_DateStruct,RTC_TimeStruct);
delay(10);
Expand Down
1 change: 1 addition & 0 deletions src/M5CoreInk.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class M5CoreInk
private:
/* data */
// WFT0154CZB3
bool _inkEnable;
public:
M5CoreInk(/* args */);
~M5CoreInk();
Expand Down