移植到 CH32V10x 既 QingKeV3 系列 MCU 上
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
#include "os_types.h"
|
||||
#endif /* INCLUDED_OS_TYPES_H */
|
||||
|
||||
#ifndef INCLUDED_OS_ALIGN_H
|
||||
#include <os_align.h>
|
||||
#endif /*INCLUDED_OS_ALIGN_H*/
|
||||
|
||||
#ifndef INCLUDED_OS_COMPILER_H
|
||||
#include "os_compiler.h"
|
||||
#endif /* INCLUDED_OS_COMPILER_H */
|
||||
@@ -13,6 +17,10 @@
|
||||
#include "os_macros.h"
|
||||
#endif /* INCLUDED_OS_MACROS_H */
|
||||
|
||||
#ifndef INCLUDED_OS_ENDIAN_H
|
||||
#include <os_endian.h>
|
||||
#endif /*INCLUDED_OS_ENDIAN_H*/
|
||||
|
||||
#ifndef INCLUDED_OS_SCHED_H
|
||||
#include <os_sched.h>
|
||||
#endif /*INCLUDED_OS_SCHED_H*/
|
||||
@@ -57,6 +65,10 @@
|
||||
#include <os_fairlock.h>
|
||||
#endif /*INCLUDED_OS_FAIRLOCK_H*/
|
||||
|
||||
#ifndef INCLUDED_OS_IDLE_H
|
||||
#include <os_idle.h>
|
||||
#endif /*INCLUDED_OS_IDLE_H*/
|
||||
|
||||
|
||||
|
||||
/* ==================================================================================================== */
|
||||
|
||||
@@ -44,4 +44,16 @@
|
||||
#define OS_CFG_DEVICE_MAX 10
|
||||
#endif /* OS_CFG_DEVICE_MAX */
|
||||
|
||||
#ifndef OS_CFG_IDLE_TASK_TICKS
|
||||
#define OS_CFG_IDLE_TASK_TICKS 5
|
||||
#endif /*OS_CFG_IDLE_TASK_TICKS*/
|
||||
|
||||
#ifndef OS_CFG_IDLE_TASK_STACK_SIZE
|
||||
#define OS_CFG_IDLE_TASK_STACK_SIZE 1024
|
||||
#endif /*OS_CFG_IDLE_TASK_STACK_SIZE*/
|
||||
|
||||
#ifndef OS_CFG_IDLE_TASK_PRIORITY
|
||||
#define OS_CFG_IDLE_TASK_PRIORITY OS_PRIORITY_IDLE
|
||||
#endif /*OS_CFG_IDLE_TASK_PRIORITY*/
|
||||
|
||||
#endif /*INCLUDED_OS_CONFIG_H*/
|
||||
|
||||
@@ -12,13 +12,14 @@ volatile os_bool_t g_os_port_context_switch_flag;
|
||||
|
||||
|
||||
void os_port_on_switch_success(void){
|
||||
os_critical_enter_in_isr();
|
||||
// os_critical_enter_in_isr();
|
||||
g_os_sched_current_task_p = g_os_port_switch_to_sp;
|
||||
g_os_sched_current_task_p->state = kOsTaskState_Running;
|
||||
g_os_port_context_switch_flag = OS_FALSE;
|
||||
os_critical_leave_in_isr();
|
||||
// os_critical_leave_in_isr();
|
||||
}
|
||||
|
||||
OS_WEAK
|
||||
void os_port_context_switch(void* from_sp, void* to_sp){
|
||||
os_critical_enter_in_isr();
|
||||
if(g_os_port_context_switch_flag==OS_TRUE){
|
||||
|
||||
@@ -33,8 +33,8 @@ os_stack_t os_port_cpu_stack_init(os_task_entry_t entry, void* param
|
||||
|
||||
/*
|
||||
* 请求上下文切换
|
||||
* @param from_sp - 切换的源头任务栈
|
||||
* @param to_sp - 切换的目标任务栈
|
||||
* @param from_sp - 切换的源头任务栈指针
|
||||
* @param to_sp - 切换的目标任务栈指针
|
||||
*/
|
||||
void os_port_context_switch(void* from_sp, void* to_sp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user