aboutsummaryrefslogtreecommitdiffstats
path: root/os/common
diff options
context:
space:
mode:
Diffstat (limited to 'os/common')
-rw-r--r--os/common/ports/AVR/chcore.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/os/common/ports/AVR/chcore.c b/os/common/ports/AVR/chcore.c
index ca70ccc5f..77f6ace9f 100644
--- a/os/common/ports/AVR/chcore.c
+++ b/os/common/ports/AVR/chcore.c
@@ -150,7 +150,12 @@ void _port_thread_start(void) {
asm volatile ("movw r24, r4");
asm volatile ("movw r30, r2");
asm volatile ("icall");
- asm volatile ("call chSysHalt");
+#if defined(_CHIBIOS_RT_)
+ asm volatile ("call chThdExit"); /* Used for avr5 Architecture. */
+#endif
+#if defined(_CHIBIOS_NIL_)
+ asm volatile ("call chSysHalt"); /* Used for avr5 Architecture. */
+#endif
}
/** @} */