Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clock initialization missing #108

Merged
merged 2 commits into from
Aug 2, 2024
Merged
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: 0 additions & 1 deletion src/core/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ void runClockLoop() {
#if defined(STICK_C_PLUS) || defined(STICK_C_PLUS2)
RTC_TimeTypeDef _time;
cplus_RTC _rtc;
_rtc.begin();
_rtc.GetBm8563Time();
_rtc.GetTime(&_time);
#endif
Expand Down
14 changes: 14 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,19 @@ void load_eeprom() {
EEPROM.end();
}

/*********************************************************************
** Function: init_clock
** Clock initialisation for propper display in menu
*********************************************************************/
void init_clock() {
#if defined(STICK_C_PLUS) || defined(STICK_C_PLUS2)
RTC_TimeTypeDef _time;
cplus_RTC _rtc;
_rtc.begin();
_rtc.GetBm8563Time();
_rtc.GetTime(&_time);
#endif
}

/*********************************************************************
** Function: setup
Expand All @@ -227,6 +240,7 @@ void setup() {
begin_tft();
load_eeprom();
boot_screen();
init_clock();

if(!LittleFS.begin(true)) { LittleFS.format(), LittleFS.begin();}

Expand Down
Loading