We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 622d0eb commit 09e85b7Copy full SHA for 09e85b7
src/runtime/runtime_stm32f103xx.go
@@ -124,8 +124,8 @@ func ticks() timeUnit {
124
// convert RTC counter from seconds to microseconds
125
timerCounter := uint64(stm32.RTC.CNTH<<16|stm32.RTC.CNTL) * 1000 * 1000
126
127
- // add the fractional part of current time using DIV registers
128
- timerCounter += (uint64(stm32.RTC.DIVH<<16|stm32.RTC.DIVL) / 1024 * 32 * 32) * 1000 * 1000
+ // add the fractional part of current time using DIV register
+ timerCounter += uint64(0x8000-stm32.RTC.DIVL) * 31
129
130
// change since last measurement
131
offset := (timerCounter - timerLastCounter)
0 commit comments