mirror of
https://github.com/kelvinlawson/atomthreads.git
synced 2026-01-11 18:33:16 +01:00
Make atomthreads assemble with SDCC
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
; uint8_t get_cc(void);
|
||||
_get_cc::
|
||||
push cc
|
||||
pop a
|
||||
ret
|
||||
|
||||
; void set_cc(uint8_t);
|
||||
_set_cc::
|
||||
ld a, (3, sp)
|
||||
push a
|
||||
pop cc
|
||||
ret
|
||||
|
||||
; void archContextSwitch (ATOM_TCB *old_tcb_ptr, ATOM_TCB *new_tcb_ptr)
|
||||
_archContextSwitch::
|
||||
|
||||
; save context
|
||||
ldw x, (3, sp)
|
||||
ldw y, sp
|
||||
ldw (x), y
|
||||
|
||||
; restore context
|
||||
ldw x, (5, sp)
|
||||
jra restore
|
||||
|
||||
; void archFirstThreadRestore (ATOM_TCB *new_tcb_ptr)
|
||||
_archFirstThreadRestore::
|
||||
|
||||
; restore context
|
||||
ldw x, (3, sp)
|
||||
restore:
|
||||
ldw x, (x)
|
||||
ldw sp, x
|
||||
|
||||
ret
|
||||
|
||||
|
||||
@@ -95,6 +95,8 @@ static NO_REG_SAVE void thread_shell (void)
|
||||
rim();
|
||||
#elif defined(__RCSTM8__)
|
||||
_rim_();
|
||||
#elif defined(__SDCC_stm8)
|
||||
__asm__("rim");
|
||||
#endif
|
||||
|
||||
/* Call the thread entry point */
|
||||
@@ -293,6 +295,7 @@ void archInitSystemTickTimer ( void )
|
||||
INTERRUPT void TIM1_SystemTickISR (void)
|
||||
#if defined(__RCSTM8__)
|
||||
interrupt 11
|
||||
|
||||
#elif defined(__SDCC_stm8)
|
||||
__interrupt(11)
|
||||
#endif
|
||||
@@ -309,3 +312,4 @@ __interrupt(11)
|
||||
/* Call the interrupt exit routine */
|
||||
atomIntExit(TRUE);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ vpath %.elf .\$(BUILD_DIR)
|
||||
vpath %.hex .\$(BUILD_DIR)
|
||||
|
||||
# Compiler/Assembler flags
|
||||
CFLAGS= -mstm8 -c -D $(PART) --opt-code-size --max-allocs-per-node 300
|
||||
CFLAGS= -mstm8 -c -D $(PART) --opt-code-size --max-allocs-per-node 3000
|
||||
DBG_CFLAGS= -mstm8 -c -D $(PART) --opt-code-size --max-allocs-per-node 3000
|
||||
ASMFLAGS= -off
|
||||
DBG_ASMFLAGS= -off
|
||||
|
||||
@@ -154,3 +154,19 @@ size_t __write(int handle, const unsigned char *buf, size_t bufSize)
|
||||
return (chars_written);
|
||||
}
|
||||
#endif /* __IAR_SYSTEMS_ICC__ */
|
||||
|
||||
#if defined(__SDCC_stm8)
|
||||
#if __SDCC_REVISION >= 9624
|
||||
int putchar (int c)
|
||||
{
|
||||
return(uart_putchar(c));
|
||||
}
|
||||
#else
|
||||
void putchar (char c)
|
||||
{
|
||||
uart_putchar(c);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user