stm32duino / STM32LowPower

Arduino Low Power library for STM32
183 stars 52 forks source link

Reduce flash footprint #91

Closed tshcherban closed 1 year ago

tshcherban commented 1 year ago

Replace gmtime and mktime calls within programRtcWakeUp function with a custom timeshift calculation. Saves ~15k flash and reduces alarm time calculation duration ~twice.

Fixes #90 FYI: #13, #73

fpistm commented 1 year ago

Thanks @tshcherban I will review it deeply soon. As a first feedback, I'm not agree to provide setAlarmTime as new method. So it could probably be removed and placed directly in the calling function.

tshcherban commented 1 year ago

I just moved this calculation to a separate private function to not overcomplicate a programRtcWakeUp, but of course its not critical and can be inlined manually. I'll wait for your review and amend the PR later.