Skip to content

Commit 7f917c3

Browse files
committed
WIP
1 parent eda6f52 commit 7f917c3

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/machine/board_embedfire_py32f002b.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ package machine
77

88
// LEDs
99
const (
10-
LED2 = PA1
11-
LED3 = PA5
12-
LED4 = PA4
10+
LED1 = PA1
11+
LED2 = PA5
12+
LED3 = PA4
1313
LED = LED2
1414
)
1515

src/machine/board_embedfire_py32f030.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ package machine
77

88
// LEDs
99
const (
10-
LED2 = PA2
11-
LED3 = PA3
12-
LED4 = PA4
10+
LED1 = PA2
11+
LED2 = PA3
12+
LED3 = PA4
1313
LED = LED2
1414
)
1515

src/runtime/runtime_py32.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ import (
77
"machine"
88

99
"device/py32"
10+
11+
"runtime/volatile"
1012
)
1113

14+
var tickCounter volatile.Register64
15+
1216
//export Reset_Handler
1317
func main() {
1418
preinit()
@@ -36,11 +40,9 @@ func nanosecondsToTicks(ns int64) timeUnit {
3640
return timeUnit(ns / 1000_000)
3741
}
3842

39-
var tickCounter uint64
40-
4143
//go:linkname ticks runtime.ticks
4244
func ticks() timeUnit {
43-
return timeUnit(tickCounter)
45+
return timeUnit(tickCounter.Get())
4446
}
4547

4648
func sleepTicks(d timeUnit) {
@@ -72,5 +74,5 @@ func getchar() byte {
7274

7375
//export SysTick_Handler
7476
func handleSysTick() {
75-
tickCounter = tickCounter + 1
77+
tickCounter.Set(tickCounter.Get() + 1)
7678
}

0 commit comments

Comments
 (0)