Merge pull request #59 from logicog/timer_fixes

Fix internal timer tick counter for housekeeping.
Because of the high F_CPU and low SYS_TICK.
Timer0 can easy overflow.
Now this is known and fixed.
This commit is contained in:
René van Dorst
2025-12-25 09:54:58 +00:00
committed by GitHub
3 changed files with 49 additions and 29 deletions
+5
View File
@@ -871,6 +871,11 @@ void cmd_parser(void) __banked
}
} else if (cmd_compare(0, "version")) {
print_sw_version();
} else if (cmd_compare(0, "time")) {
print_string(" Tick counter: "); print_long(ticks); print_string(" Sec Counter: ");
reg_read_m(RTL837X_REG_SEC_COUNTER);
print_sfr_data();
write_char('\n');
} else if (cmd_compare(0, "history")) {
__xdata uint16_t p = (cmd_history_ptr + 1) & CMD_HISTORY_MASK;
__xdata uint8_t found_begin = 0;