Skip to content

Commit 443dce6

Browse files
committed
WIP
1 parent 7e7ddd2 commit 443dce6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/runtime/runtime_py32.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66
"device/arm"
77

88
"machine"
9+
10+
"device/py32"
911
)
1012

1113
//export Reset_Handler
@@ -14,24 +16,24 @@ func main() {
1416

1517
machine.LED4.Configure(machine.PinConfig{Mode: machine.PinOutput})
1618

17-
ConfigureSystemTimer(8e6)
19+
py32.RCC.SetICSCR_HSI_FS(py32.RCC_ICSCR_HSI_FS_Freq24MHz)
20+
21+
ConfigureSystemTimer(24e6)
1822

1923
run()
2024
exit(0)
2125
}
2226

23-
const shift = 15
24-
2527
func ConfigureSystemTimer(systemFrequencyHz uint32) {
2628
arm.SetupSystemTimer(systemFrequencyHz / 1000)
2729
}
2830

2931
func ticksToNanoseconds(ticks timeUnit) int64 {
30-
return int64(ticks * 1_000_000)
32+
return int64(ticks * 1000_000)
3133
}
3234

3335
func nanosecondsToTicks(ns int64) timeUnit {
34-
return timeUnit(ns / 1_000_000)
36+
return timeUnit(ns / 1000_000)
3537
}
3638

3739
var tickCounter uint64

0 commit comments

Comments
 (0)