mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 21:43:40 +00:00
avr: fix time.Sleep() in init code
In the early days of TinyGo, the idea of `postinit` was to enable interrupts only after initializers have run. Which kind of makes sense... except that `time.Sleep` is allowed in init code and `time.Sleep` requires interrupts to be enabled. Therefore, interrupts must be enabled while initializers are being run. This commit simply moves the enabling of interrupts to a point right before running package initializers. It also removes `runtime.postinit`, which is not necessary anymore (and was only used on AVR).
This commit is contained in:
@@ -171,9 +171,6 @@ func TestCompiler(t *testing.T) {
|
||||
case "float.go", "math.go", "print.go":
|
||||
// Stuck in runtime.printfloat64.
|
||||
|
||||
case "goroutines.go":
|
||||
// The main() never runs.
|
||||
|
||||
case "interface.go":
|
||||
// Several comparison tests fail.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user