avr: fix default handler in interrupt vector

Apparently the target of a weak symbol must be defined in the same file
as where it is used as a weak symbol.

https://www.avrfreaks.net/forum/using-weak-custom-vector-table#comment-745922
Этот коммит содержится в:
Ayke van Laethem 2018-09-24 13:03:21 +02:00
родитель fd6dda5e4f
коммит ddd4a39cb8
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: E97FF5335DFDFDED
2 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -38,16 +38,6 @@ init_data_end:
; need to jump.
; This is the default handler for interrupts, if triggered but not defined.
; Sleep inside so that an accidentally triggered interrupt won't drain the
; battery of a battery-powered device.
.section .text.__vector_default
.global __vector_default
__vector_default:
sleep
rjmp __vector_default
; The only thing this WDT handler really does is disable itself, to get out of
; sleep mode.
.section .text.__vector_WDT

Просмотреть файл

@ -208,6 +208,15 @@ def writeAsm(outdir, device):
; Automatically generated file. DO NOT EDIT.
; Generated by gen-device-avr.py from {file}, see {descriptorSource}
; This is the default handler for interrupts, if triggered but not defined.
; Sleep inside so that an accidentally triggered interrupt won't drain the
; battery of a battery-powered device.
.section .text.__vector_default
.global __vector_default
__vector_default:
sleep
rjmp __vector_default
; Avoid the need for repeated .weak and .set instructions.
.macro IRQ handler
.weak \\handler