aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/gen-device-avr/gen-device-avr.go
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gen-device-avr/gen-device-avr.go')
-rwxr-xr-xtools/gen-device-avr/gen-device-avr.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/gen-device-avr/gen-device-avr.go b/tools/gen-device-avr/gen-device-avr.go
index ac4c8b996..8f9298a21 100755
--- a/tools/gen-device-avr/gen-device-avr.go
+++ b/tools/gen-device-avr/gen-device-avr.go
@@ -260,6 +260,7 @@ func writeGo(outdir string, device *Device) error {
package {{.pkgName}}
import (
+ "runtime/interrupt"
"runtime/volatile"
"unsafe"
)
@@ -277,6 +278,12 @@ const ({{range .interrupts}}
IRQ_max = {{.interruptMax}} // Highest interrupt number on this device.
)
+// Map interrupt numbers to function names.
+// These aren't real calls, they're removed by the compiler.
+var ({{range .interrupts}}
+ _ = interrupt.Register(IRQ_{{.Name}}, "__vector_{{.Name}}"){{end}}
+)
+
// Peripherals.
var ({{range .peripherals}}
// {{.Caption}}