spaceAngel / cyberWatch

simple OS for LillyGO T-Watch V3
https://cyberwatch.cyberdeck.cz
GNU General Public License v3.0
34 stars 9 forks source link

How to set correct time? #2

Closed arduino-man closed 2 years ago

arduino-man commented 2 years ago

I love the cyberwatch interface, however my watch is always set to a DateTime from 2019.

I've looked through the code to make a contribution that grabs the DateTime from the compiling computer and set the RTC appropriately but have not managed to figure it out.

How have you managed to set your correct time/date so far?

Thanks

arduino-man commented 2 years ago

At the moment my workaround is to add the setDateTime line as shown below (from CyberWatch.cpp), but it would be cool to simply grab the time/date from the computer that is doing the compilation instead of manually putting in the date/time.

`void CyberWatch::init() {

Serial.begin(SERIAL_RATE);
Serial.println("cyberwatch starting");

TTGOClass::getWatch()->begin();
    // Line below is new
TTGOClass::getWatch()->rtc->setDateTime(2022, 6, 27, 15, 49, 53);
TTGOClass::getWatch()->motor_begin();
Display::getInstance()->init();
BatteryManager::getInstance()->energyConsumptionSavingsSettings();
Esp32::getInstance()->initIRQ();
MoveSensor::getInstance()->initIRQ();
UserInterfaceManager::getInstance()->showSplashScreen();

};`

arduino-man commented 2 years ago

Submitted pull request 0276a08 that automatically sets the current date and time during compilation so closing this issue. Thanks!

spaceAngel commented 2 years ago

Sorry, your pull request set same time & date on every power on watches. Today I've implemented feature of run some code only once after build/upload, which set date & time. (used some part of your code, thanks!)