Skip to content

Commit

Permalink
Merge pull request #108 from valentin8709/extended
Browse files Browse the repository at this point in the history
Fix clock initialization missing
  • Loading branch information
pr3y authored Aug 2, 2024
2 parents 7a3d461 + 9cd2cbe commit bb4b0f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
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

0 comments on commit bb4b0f3

Please sign in to comment.