Skip to content

Commit

Permalink
bugfix rtc time updating last runtime when the interval changed
Browse files Browse the repository at this point in the history
  • Loading branch information
itzandroidtab committed Mar 24, 2024
1 parent bff04d5 commit a92ca8f
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions ui/totp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,23 @@ namespace menu {
totp_changed = true;
}

// check if we should update the hashes
if ((Rtc::get() != last_epoch) || (last_interval != entries[current].interval)) {
// store the new epoch value
last_epoch = Rtc::get();

// get the runtime for the timing circle
last_epoch_runtime = klib::io::systick<>::get_runtime();
// get the rtc time
const auto time = Rtc::get();

// update the epoch buffer
klib::string::itoa(last_epoch.value, epoch_buf);
// check if we should update the hashes
if ((time != last_epoch) || (last_interval != entries[current].interval)) {
// only update the last epoch and runtime when the
// time has changed
if (time != last_epoch) {
// store the new epoch value
last_epoch = time;

// get the runtime for the timing circle
last_epoch_runtime = klib::io::systick<>::get_runtime();

// update the epoch buffer
klib::string::itoa(last_epoch.value, epoch_buf);
}

// update the seconds left in this cycle
klib::string::itoa(
Expand Down

0 comments on commit a92ca8f

Please # to comment.