Skip to content

Commit 8cd2a46

Browse files
aykevldeadprogram
authored andcommitted
runtime: remove the asyncScheduler constant
There is no reason to specialize this per chip as it is only ever used for JavaScript. Not only that, it is causing confusion and is yet another quirk to learn when porting the runtime to a new microcontroller.
1 parent 25b045d commit 8cd2a46

25 files changed

+8
-52
lines changed

src/runtime/runtime_arm7tdmi.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ func ticks() timeUnit {
7171
return 0
7272
}
7373

74-
const asyncScheduler = false
75-
7674
func sleepTicks(d timeUnit) {
7775
// TODO
7876
}

src/runtime/runtime_atsamd21.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,6 @@ var rtcOverflows volatile.Register32 // number of times the RTC wrapped around
243243

244244
var timerWakeup volatile.Register8
245245

246-
const asyncScheduler = false
247-
248246
// ticksToNanoseconds converts RTC ticks (at 32768Hz) to nanoseconds.
249247
func ticksToNanoseconds(ticks timeUnit) int64 {
250248
// The following calculation is actually the following, but with both sides

src/runtime/runtime_atsamd51.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ var rtcOverflows volatile.Register32 // number of times the RTC wrapped around
232232

233233
var timerWakeup volatile.Register8
234234

235-
const asyncScheduler = false
236-
237235
// ticksToNanoseconds converts RTC ticks (at 32768Hz) to nanoseconds.
238236
func ticksToNanoseconds(ticks timeUnit) int64 {
239237
// The following calculation is actually the following, but with both sides

src/runtime/runtime_avr.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ func init() {
5858
initUART()
5959
}
6060

61-
const asyncScheduler = false
62-
6361
const tickNanos = 1024 * 16384 // roughly 16ms in nanoseconds
6462

6563
func ticksToNanoseconds(ticks timeUnit) int64 {

src/runtime/runtime_cortexm_qemu.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ func main() {
2727
abort()
2828
}
2929

30-
const asyncScheduler = false
31-
3230
func ticksToNanoseconds(ticks timeUnit) int64 {
3331
return int64(ticks)
3432
}

src/runtime/runtime_esp32.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ func ticks() timeUnit {
9797
return timeUnit(uint64(esp.TIMG0.T0LO.Get()) | uint64(esp.TIMG0.T0HI.Get())<<32)
9898
}
9999

100-
const asyncScheduler = false
101-
102100
func nanosecondsToTicks(ns int64) timeUnit {
103101
// Calculate the number of ticks from the number of nanoseconds. At a 80MHz
104102
// APB clock, that's 25 nanoseconds per tick with a timer prescaler of 2:

src/runtime/runtime_esp8266.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ func ticks() timeUnit {
8989
return currentTime
9090
}
9191

92-
const asyncScheduler = false
93-
9492
const tickNanos = 3200 // time.Second / (80MHz / 256)
9593

9694
func ticksToNanoseconds(ticks timeUnit) int64 {

src/runtime/runtime_fe310.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ func putchar(c byte) {
100100
machine.UART0.WriteByte(c)
101101
}
102102

103-
const asyncScheduler = false
104-
105103
var timerWakeup volatile.Register8
106104

107105
func ticks() timeUnit {

src/runtime/runtime_k210.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ func putchar(c byte) {
112112
machine.UART0.WriteByte(c)
113113
}
114114

115-
const asyncScheduler = false
116-
117115
var timerWakeup volatile.Register8
118116

119117
func ticks() timeUnit {

src/runtime/runtime_mimxrt1062.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import (
1010
"unsafe"
1111
)
1212

13-
const asyncScheduler = false
14-
1513
//go:extern _svectors
1614
var _svectors [0]byte
1715

0 commit comments

Comments
 (0)