Skip to content

Commit

Permalink
fix cm300 timer
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeykt committed Apr 10, 2024
1 parent 1f31e49 commit 4379e5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mcu_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ void TIMER_Clock(uint64_t cycles)
uint32_t value = timer.tcnt;
uint32_t matcha = value == timer.tcora;
uint32_t matchb = value == timer.tcorb;
if ((timer.tcsr & 24) == 8 && matcha)
if ((timer.tcr & 24) == 8 && matcha)
value = 0;
else if ((timer.tcsr & 24) == 16 && matchb)
else if ((timer.tcr & 24) == 16 && matchb)
value = 0;
else
value++;
Expand Down

0 comments on commit 4379e5a

Please sign in to comment.