diff --git a/CPU/QingKeV3/os_port.c b/CPU/QingKeV3/os_port.c index 706fc10..7ee3bb5 100644 --- a/CPU/QingKeV3/os_port.c +++ b/CPU/QingKeV3/os_port.c @@ -5,6 +5,7 @@ #include "os_compiler.h" #include "os_systick.h" #include "os_sched.h" +#include "os_isr.h" #include "qkv3.h" /* ------------------------------------------------------------------------------------------------------------------ */ @@ -16,7 +17,8 @@ /* ------------------------------------------------------------------------------------------------------------------ */ /* */ -static uint32_t _SysTick_Config(os_tick_t ticks) +OS_STATIC_FORCE_INLINE +uint32_t _SysTick_Config(os_tick_t ticks) { QKV3_PFIC->CFGR=0xFA050003; /* 关闭硬件压栈和嵌套 */ /* @@ -187,6 +189,7 @@ void os_port_context_switch(void* from_sp, void* to_sp){ void SysTick_Handler(void) __attribute__((interrupt())); void SysTick_Handler(void){ + os_isr_enter(); QKV3_SysTick->CTLR=0; QKV3_SysTick->CNTL0=0;QKV3_SysTick->CNTL1=0;QKV3_SysTick->CNTL2=0;QKV3_SysTick->CNTL3=0; QKV3_SysTick->CNTH0=0;QKV3_SysTick->CNTH1=0;QKV3_SysTick->CNTH2=0;QKV3_SysTick->CNTH3=0; @@ -194,5 +197,6 @@ void SysTick_Handler(void){ // 调用系统心跳处理 os_systick_tick(); + os_isr_leave(); } diff --git a/CPU/QingKeV3/qkv3.h b/CPU/QingKeV3/qkv3.h index a676fcd..f27fe42 100644 --- a/CPU/QingKeV3/qkv3.h +++ b/CPU/QingKeV3/qkv3.h @@ -38,8 +38,6 @@ #define QKV3_SysTick ((QKV3_SysTick_Type *) 0xE000F000) - - /* ------------------------------------------------------------------------------------------------------------------ */ /* */ diff --git a/Kernel/SingleCore/os_config.h.in b/Kernel/SingleCore/os_config.h.in index 92d72d8..e6ac75b 100644 --- a/Kernel/SingleCore/os_config.h.in +++ b/Kernel/SingleCore/os_config.h.in @@ -4,6 +4,7 @@ /* ==================================================================================================== */ /* OPTIONS */ +#cmakedefine OS_ALIGN_SIZE @OS_ALIGN_SIZE@ #cmakedefine OS_CFG_CPU_INT_NBITS @OS_CFG_CPU_INT_NBITS@ #cmakedefine OS_CFG_TICKS_PER_SECOND @OS_CFG_TICKS_PER_SECOND@ #cmakedefine OS_CFG_SYSCALL_PRIORITY @OS_CFG_SYSCALL_PRIORITY@ @@ -17,6 +18,7 @@ #cmakedefine OS_CFG_DEVICE_MAX @OS_CFG_DEVICE_MAX@ + /* ==================================================================================================== */ /* DEFAULT */ diff --git a/Kernel/SingleCore/os_timewheel.c b/Kernel/SingleCore/os_timewheel.c index 73b51a7..f89938d 100644 --- a/Kernel/SingleCore/os_timewheel.c +++ b/Kernel/SingleCore/os_timewheel.c @@ -5,11 +5,17 @@ /* -------------------------------------------------------------------------------------------------------------- */ /* */ +OS_ALIGNED(OS_ALIGN_SIZE) os_list_t os_timewheel__R[TWR_SIZE]; +OS_ALIGNED(OS_ALIGN_SIZE) os_list_t os_timewheel__N0[TWN_SIZE]; +OS_ALIGNED(OS_ALIGN_SIZE) os_list_t os_timewheel__N1[TWN_SIZE]; +OS_ALIGNED(OS_ALIGN_SIZE) os_list_t os_timewheel__N2[TWN_SIZE]; +OS_ALIGNED(OS_ALIGN_SIZE) os_list_t os_timewheel__N3[TWN_SIZE]; + volatile os_tick_t os_timewheel__tick;