support stm8
1. see: TencentOS-tiny\board\STM8L052R8T6\IAR\hello_world 2. compile/debug/run with IAR for STM8
This commit is contained in:
@@ -65,19 +65,19 @@ __API__ cpu_cpsr_t tos_cpu_cpsr_save(void);
|
||||
__API__ void tos_cpu_cpsr_restore(cpu_cpsr_t cpsr);
|
||||
|
||||
|
||||
__KERNEL__ void cpu_init(void);
|
||||
__KNL__ void cpu_init(void);
|
||||
|
||||
__KERNEL__ void cpu_reset(void);
|
||||
__KNL__ void cpu_reset(void);
|
||||
|
||||
__KERNEL__ void cpu_systick_init(k_cycle_t cycle_per_tick);
|
||||
__KNL__ void cpu_systick_init(k_cycle_t cycle_per_tick);
|
||||
|
||||
__KERNEL__ void cpu_sched_start(void);
|
||||
__KNL__ void cpu_sched_start(void);
|
||||
|
||||
__KERNEL__ void cpu_context_switch(void);
|
||||
__KNL__ void cpu_context_switch(void);
|
||||
|
||||
__KERNEL__ void cpu_irq_context_switch(void);
|
||||
__KNL__ void cpu_irq_context_switch(void);
|
||||
|
||||
__KERNEL__ k_stack_t *cpu_task_stk_init(void *entry,
|
||||
__KNL__ k_stack_t *cpu_task_stk_init(void *entry,
|
||||
void *arg,
|
||||
void *exit,
|
||||
k_stack_t *stk_base,
|
||||
@@ -85,29 +85,29 @@ __KERNEL__ k_stack_t *cpu_task_stk_init(void *entry,
|
||||
|
||||
#if TOS_CFG_TICKLESS_EN > 0u
|
||||
|
||||
__KERNEL__ void cpu_systick_resume(void);
|
||||
__KNL__ void cpu_systick_resume(void);
|
||||
|
||||
__KERNEL__ void cpu_systick_suspend(void);
|
||||
__KNL__ void cpu_systick_suspend(void);
|
||||
|
||||
__KERNEL__ void cpu_systick_reload_reset(void);
|
||||
__KNL__ void cpu_systick_reload_reset(void);
|
||||
|
||||
__KERNEL__ void cpu_systick_pending_reset(void);
|
||||
__KNL__ void cpu_systick_pending_reset(void);
|
||||
|
||||
__KERNEL__ k_time_t cpu_systick_max_delay_millisecond(void);
|
||||
__KNL__ k_time_t cpu_systick_max_delay_millisecond(void);
|
||||
|
||||
__KERNEL__ void cpu_systick_expires_set(k_time_t millisecond);
|
||||
__KNL__ void cpu_systick_expires_set(k_time_t millisecond);
|
||||
|
||||
__KERNEL__ void cpu_systick_reset(void);
|
||||
__KNL__ void cpu_systick_reset(void);
|
||||
|
||||
#endif
|
||||
|
||||
#if TOS_CFG_PWR_MGR_EN > 0u
|
||||
|
||||
__KERNEL__ void cpu_sleep_mode_enter(void);
|
||||
__KNL__ void cpu_sleep_mode_enter(void);
|
||||
|
||||
__KERNEL__ void cpu_stop_mode_enter(void);
|
||||
__KNL__ void cpu_stop_mode_enter(void);
|
||||
|
||||
__KERNEL__ void cpu_standby_mode_enter(void);
|
||||
__KNL__ void cpu_standby_mode_enter(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -18,16 +18,13 @@
|
||||
#ifndef _TOS_CPU_DEF_H_
|
||||
#define _TOS_CPU_DEF_H_
|
||||
|
||||
enum CPU_WORD_SIZE {
|
||||
CPU_WORD_SIZE_08,
|
||||
CPU_WORD_SIZE_16,
|
||||
CPU_WORD_SIZE_32,
|
||||
CPU_WORD_SIZE_64,
|
||||
};
|
||||
#define CPU_WORD_SIZE_08 1
|
||||
#define CPU_WORD_SIZE_16 2
|
||||
#define CPU_WORD_SIZE_32 3
|
||||
#define CPU_WORD_SIZE_64 4
|
||||
|
||||
enum CPU_STK_GROWTH {
|
||||
CPU_STK_GROWTH_ASCENDING,
|
||||
CPU_STK_GROWTH_DESCENDING,
|
||||
};
|
||||
#define CPU_STK_GROWTH_ASCENDING 1
|
||||
#define CPU_STK_GROWTH_DESCENDING 2
|
||||
|
||||
#endif /* _TOS_CPU_DEF_H_ */
|
||||
|
||||
|
@@ -26,13 +26,13 @@
|
||||
k_stack_t k_irq_stk[TOS_CFG_IRQ_STK_SIZE];
|
||||
k_stack_t *k_irq_stk_top = k_irq_stk + TOS_CFG_IRQ_STK_SIZE;
|
||||
|
||||
__KERNEL__ void cpu_systick_init(k_cycle_t cycle_per_tick)
|
||||
__KNL__ void cpu_systick_init(k_cycle_t cycle_per_tick)
|
||||
{
|
||||
port_systick_priority_set(TOS_CFG_CPU_SYSTICK_PRIO);
|
||||
port_systick_config(cycle_per_tick);
|
||||
}
|
||||
|
||||
__KERNEL__ void cpu_init(void) {
|
||||
__KNL__ void cpu_init(void) {
|
||||
|
||||
// reserve storage space for sp registers
|
||||
k_irq_stk_top = (k_stack_t *)(((cpu_addr_t) k_irq_stk_top) - sizeof(cpu_data_t));
|
||||
@@ -67,17 +67,17 @@ __API__ void tos_cpu_cpsr_restore(cpu_cpsr_t cpsr)
|
||||
}
|
||||
|
||||
|
||||
__KERNEL__ void cpu_context_switch(void)
|
||||
__KNL__ void cpu_context_switch(void)
|
||||
{
|
||||
port_context_switch();
|
||||
}
|
||||
|
||||
__KERNEL__ void cpu_irq_context_switch(void)
|
||||
__KNL__ void cpu_irq_context_switch(void)
|
||||
{
|
||||
// DO NOTHING
|
||||
}
|
||||
|
||||
__KERNEL__ void cpu_sched_start(void)
|
||||
__KNL__ void cpu_sched_start(void)
|
||||
{
|
||||
port_sched_start();
|
||||
}
|
||||
@@ -120,7 +120,7 @@ Inx Offset Register
|
||||
|
||||
*/
|
||||
|
||||
__KERNEL__ k_stack_t *cpu_task_stk_init(void *entry,
|
||||
__KNL__ k_stack_t *cpu_task_stk_init(void *entry,
|
||||
void *arg,
|
||||
void *exit,
|
||||
k_stack_t *stk_base,
|
||||
|
Reference in New Issue
Block a user