diff --git a/arch/arm/arm-v6m/common/tos_cpu.c b/arch/arm/arm-v6m/common/tos_cpu.c index 4c854c15..5b94d7b8 100644 --- a/arch/arm/arm-v6m/common/tos_cpu.c +++ b/arch/arm/arm-v6m/common/tos_cpu.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include __API__ uint32_t tos_cpu_clz(uint32_t val) { diff --git a/arch/arm/arm-v6m/common/tos_fault.c b/arch/arm/arm-v6m/common/tos_fault.c index d2f2e951..65ae7e02 100644 --- a/arch/arm/arm-v6m/common/tos_fault.c +++ b/arch/arm/arm-v6m/common/tos_fault.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_FAULT_BACKTRACE_EN > 0u diff --git a/arch/arm/arm-v6m/cortex-m0/armcc/port_c.c b/arch/arm/arm-v6m/cortex-m0/armcc/port_c.c index ca6d01e6..2776a71c 100644 --- a/arch/arm/arm-v6m/cortex-m0/armcc/port_c.c +++ b/arch/arm/arm-v6m/cortex-m0/armcc/port_c.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "core_cm0.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v6m/cortex-m0/gcc/port_c.c b/arch/arm/arm-v6m/cortex-m0/gcc/port_c.c index ca6d01e6..2776a71c 100644 --- a/arch/arm/arm-v6m/cortex-m0/gcc/port_c.c +++ b/arch/arm/arm-v6m/cortex-m0/gcc/port_c.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "core_cm0.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v6m/cortex-m0/iccarm/port_c.c b/arch/arm/arm-v6m/cortex-m0/iccarm/port_c.c index ca6d01e6..2776a71c 100644 --- a/arch/arm/arm-v6m/cortex-m0/iccarm/port_c.c +++ b/arch/arm/arm-v6m/cortex-m0/iccarm/port_c.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "core_cm0.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v7m/common/tos_cpu.c b/arch/arm/arm-v7m/common/tos_cpu.c index 4c854c15..5b94d7b8 100644 --- a/arch/arm/arm-v7m/common/tos_cpu.c +++ b/arch/arm/arm-v7m/common/tos_cpu.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include __API__ uint32_t tos_cpu_clz(uint32_t val) { diff --git a/arch/arm/arm-v7m/common/tos_fault.c b/arch/arm/arm-v7m/common/tos_fault.c index d2f2e951..65ae7e02 100644 --- a/arch/arm/arm-v7m/common/tos_fault.c +++ b/arch/arm/arm-v7m/common/tos_fault.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_FAULT_BACKTRACE_EN > 0u diff --git a/arch/arm/arm-v7m/cortex-m0+/armcc/port_c.c b/arch/arm/arm-v7m/cortex-m0+/armcc/port_c.c index b2e55608..e907e7f7 100644 --- a/arch/arm/arm-v7m/cortex-m0+/armcc/port_c.c +++ b/arch/arm/arm-v7m/cortex-m0+/armcc/port_c.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #include "core_cm0plus.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v7m/cortex-m0+/gcc/port_c.c b/arch/arm/arm-v7m/cortex-m0+/gcc/port_c.c index b2e55608..e907e7f7 100644 --- a/arch/arm/arm-v7m/cortex-m0+/gcc/port_c.c +++ b/arch/arm/arm-v7m/cortex-m0+/gcc/port_c.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #include "core_cm0plus.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v7m/cortex-m0+/iccarm/port_c.c b/arch/arm/arm-v7m/cortex-m0+/iccarm/port_c.c index b2e55608..e907e7f7 100644 --- a/arch/arm/arm-v7m/cortex-m0+/iccarm/port_c.c +++ b/arch/arm/arm-v7m/cortex-m0+/iccarm/port_c.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #include "core_cm0plus.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v7m/cortex-m3/armcc/port_c.c b/arch/arm/arm-v7m/cortex-m3/armcc/port_c.c index 63a5ce04..e51dd641 100644 --- a/arch/arm/arm-v7m/cortex-m3/armcc/port_c.c +++ b/arch/arm/arm-v7m/cortex-m3/armcc/port_c.c @@ -17,9 +17,9 @@ /* * The MIT License (MIT) - * + * * Copyright (c) 2016-2018 Armink (armink.ztl@gmail.com) - * + * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * 'Software'), to deal in the Software without restriction, including @@ -27,10 +27,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -40,7 +40,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "tos.h" +#include "tos_k.h" #include "core_cm3.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v7m/cortex-m3/gcc/port_c.c b/arch/arm/arm-v7m/cortex-m3/gcc/port_c.c index 45bfa2b3..72ec7d56 100644 --- a/arch/arm/arm-v7m/cortex-m3/gcc/port_c.c +++ b/arch/arm/arm-v7m/cortex-m3/gcc/port_c.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #include "core_cm3.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v7m/cortex-m4/armcc/port_c.c b/arch/arm/arm-v7m/cortex-m4/armcc/port_c.c index 99a2ad1b..625a550a 100644 --- a/arch/arm/arm-v7m/cortex-m4/armcc/port_c.c +++ b/arch/arm/arm-v7m/cortex-m4/armcc/port_c.c @@ -17,9 +17,9 @@ /* * The MIT License (MIT) - * + * * Copyright (c) 2016-2018 Armink (armink.ztl@gmail.com) - * + * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * 'Software'), to deal in the Software without restriction, including @@ -27,10 +27,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -40,7 +40,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "tos.h" +#include "tos_k.h" #include "core_cm4.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v7m/cortex-m4/gcc/port_c.c b/arch/arm/arm-v7m/cortex-m4/gcc/port_c.c index 26eaa271..e59dbe08 100644 --- a/arch/arm/arm-v7m/cortex-m4/gcc/port_c.c +++ b/arch/arm/arm-v7m/cortex-m4/gcc/port_c.c @@ -17,9 +17,9 @@ /* * The MIT License (MIT) - * + * * Copyright (c) 2016-2018 Armink (armink.ztl@gmail.com) - * + * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * 'Software'), to deal in the Software without restriction, including @@ -27,10 +27,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -40,7 +40,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "tos.h" +#include "tos_k.h" #include "core_cm4.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v7m/cortex-m4/iccarm/port_c.c b/arch/arm/arm-v7m/cortex-m4/iccarm/port_c.c index 99a2ad1b..625a550a 100644 --- a/arch/arm/arm-v7m/cortex-m4/iccarm/port_c.c +++ b/arch/arm/arm-v7m/cortex-m4/iccarm/port_c.c @@ -17,9 +17,9 @@ /* * The MIT License (MIT) - * + * * Copyright (c) 2016-2018 Armink (armink.ztl@gmail.com) - * + * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * 'Software'), to deal in the Software without restriction, including @@ -27,10 +27,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -40,7 +40,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "tos.h" +#include "tos_k.h" #include "core_cm4.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v7m/cortex-m7/armcc/port_c.c b/arch/arm/arm-v7m/cortex-m7/armcc/port_c.c index 93bf1134..eabb3fe0 100644 --- a/arch/arm/arm-v7m/cortex-m7/armcc/port_c.c +++ b/arch/arm/arm-v7m/cortex-m7/armcc/port_c.c @@ -17,9 +17,9 @@ /* * The MIT License (MIT) - * + * * Copyright (c) 2016-2018 Armink (armink.ztl@gmail.com) - * + * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * 'Software'), to deal in the Software without restriction, including @@ -27,10 +27,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -40,7 +40,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "tos.h" +#include "tos_k.h" #include "core_cm7.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v7m/cortex-m7/gcc/port_c.c b/arch/arm/arm-v7m/cortex-m7/gcc/port_c.c index c8eb6c9a..931759e4 100644 --- a/arch/arm/arm-v7m/cortex-m7/gcc/port_c.c +++ b/arch/arm/arm-v7m/cortex-m7/gcc/port_c.c @@ -1,8 +1,8 @@ /* * The MIT License (MIT) - * + * * Copyright (c) 2016-2018 Armink (armink.ztl@gmail.com) - * + * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * 'Software'), to deal in the Software without restriction, including @@ -10,10 +10,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -23,7 +23,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "tos.h" +#include "tos_k.h" #include "core_cm7.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v7m/cortex-m7/iccarm/port_c.c b/arch/arm/arm-v7m/cortex-m7/iccarm/port_c.c index 5dd2c4a1..1734907d 100644 --- a/arch/arm/arm-v7m/cortex-m7/iccarm/port_c.c +++ b/arch/arm/arm-v7m/cortex-m7/iccarm/port_c.c @@ -1,8 +1,8 @@ /* * The MIT License (MIT) - * + * * Copyright (c) 2016-2018 Armink (armink.ztl@gmail.com) - * + * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * 'Software'), to deal in the Software without restriction, including @@ -10,10 +10,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -23,7 +23,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "tos.h" +#include "tos_k.h" #include "core_cm7.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v8m/common/tos_cpu.c b/arch/arm/arm-v8m/common/tos_cpu.c index 4c854c15..5b94d7b8 100644 --- a/arch/arm/arm-v8m/common/tos_cpu.c +++ b/arch/arm/arm-v8m/common/tos_cpu.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include __API__ uint32_t tos_cpu_clz(uint32_t val) { diff --git a/arch/arm/arm-v8m/common/tos_fault.c b/arch/arm/arm-v8m/common/tos_fault.c index d2f2e951..65ae7e02 100644 --- a/arch/arm/arm-v8m/common/tos_fault.c +++ b/arch/arm/arm-v8m/common/tos_fault.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_FAULT_BACKTRACE_EN > 0u diff --git a/arch/arm/arm-v8m/cortex-m23/armcc/port_c.c b/arch/arm/arm-v8m/cortex-m23/armcc/port_c.c index c27b22b1..6705e877 100644 --- a/arch/arm/arm-v8m/cortex-m23/armcc/port_c.c +++ b/arch/arm/arm-v8m/cortex-m23/armcc/port_c.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #include "core_cm23.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v8m/cortex-m23/gcc/port_c.c b/arch/arm/arm-v8m/cortex-m23/gcc/port_c.c index b2e55608..e907e7f7 100644 --- a/arch/arm/arm-v8m/cortex-m23/gcc/port_c.c +++ b/arch/arm/arm-v8m/cortex-m23/gcc/port_c.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #include "core_cm0plus.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/arm/arm-v8m/cortex-m23/iccarm/port_c.c b/arch/arm/arm-v8m/cortex-m23/iccarm/port_c.c index b2e55608..e907e7f7 100644 --- a/arch/arm/arm-v8m/cortex-m23/iccarm/port_c.c +++ b/arch/arm/arm-v8m/cortex-m23/iccarm/port_c.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #include "core_cm0plus.h" __PORT__ void port_cpu_reset(void) diff --git a/arch/linux/common/tos_cpu.c b/arch/linux/common/tos_cpu.c index aa600949..08662153 100644 --- a/arch/linux/common/tos_cpu.c +++ b/arch/linux/common/tos_cpu.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include __API__ uint32_t tos_cpu_clz(uint32_t val) { diff --git a/arch/linux/common/tos_fault.c b/arch/linux/common/tos_fault.c index d2f2e951..65ae7e02 100644 --- a/arch/linux/common/tos_fault.c +++ b/arch/linux/common/tos_fault.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_FAULT_BACKTRACE_EN > 0u diff --git a/arch/linux/posix/gcc/port.c b/arch/linux/posix/gcc/port.c index ee199d31..58c31d88 100644 --- a/arch/linux/posix/gcc/port.c +++ b/arch/linux/posix/gcc/port.c @@ -17,9 +17,9 @@ /* * The MIT License (MIT) - * + * * Copyright (c) 2016-2018 Armink (armink.ztl@gmail.com) - * + * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * 'Software'), to deal in the Software without restriction, including @@ -27,10 +27,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -40,7 +40,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "tos.h" +#include "tos_k.h" #include #include @@ -131,7 +131,7 @@ __PORT__ pthread_t port_create_thread(void *arg) return thread_id; } -__PORT__ void port_sched_start(void) +__PORT__ void port_sched_start(void) { k_curr_task = k_next_task; _resume_task(k_curr_task); @@ -196,8 +196,8 @@ __PORT__ void port_init(void) _install_signal(SIG_CONTEXT_SWITCH, _handle_context_switch); } -__PORT__ void port_delay_ms(uint32_t ms) -{ +__PORT__ void port_delay_ms(uint32_t ms) +{ uint64_t start_time = _get_time_ms(); do{ usleep(100); @@ -352,7 +352,7 @@ __PORT__ void port_standby_mode_enter(void) __STATIC__ void port_fault_do_diagnosis(port_fault_regs_t *regs) { k_fault_log_writer("\n\n====================== Fault Diagnosis =====================\n"); - + } __PORT__ void port_fault_diagnosis(void) diff --git a/arch/msp430/MSP430X/icc430/port_c.c b/arch/msp430/MSP430X/icc430/port_c.c index bb40f1f3..24b2b6ac 100644 --- a/arch/msp430/MSP430X/icc430/port_c.c +++ b/arch/msp430/MSP430X/icc430/port_c.c @@ -1,8 +1,8 @@ -#include "tos.h" +#include "tos_k.h" __PORT__ void port_cpu_reset(void) { - WDTCTL = WDTPW | 0xff00; // write a wrong Watchdog timer password will cause a PUC(reset) + WDTCTL = WDTPW | 0xff00; // write a wrong Watchdog timer password will cause a PUC(reset) } __PORT__ void port_systick_config(uint32_t cycle_per_tick) @@ -42,7 +42,7 @@ __PORT__ void port_setup_systick(void) /* The MSP430X port uses a callback function to configure its tick interrupt. */ -#pragma vector=TIMER0_A0_VECTOR +#pragma vector=TIMER0_A0_VECTOR __PORT__ __interrupt __raw void timer0_isr( void ) { extern void port_systick_isr( void ); @@ -110,7 +110,7 @@ __PORT__ void port_fault_diagnosis(void) /*------------------ 430 IAR Compiler-------------------*/ #if defined (__ICC430__) // __IAR_SYSTEMS_ICC__ -#endif +#endif #endif /* TOS_CFG_FAULT_BACKTRACE_EN */ diff --git a/arch/msp430/common/tos_cpu.c b/arch/msp430/common/tos_cpu.c index b8d8cecc..e22e535e 100644 --- a/arch/msp430/common/tos_cpu.c +++ b/arch/msp430/common/tos_cpu.c @@ -1,4 +1,21 @@ -#include +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#include uint8_t irq_context_switch_flag = 0; @@ -183,12 +200,12 @@ __KERNEL__ k_stack_t *cpu_task_stk_init(void *entry, uint32_t *pul_top_of_stack; #define PORT_BYTE_ALIGNMENT_MASK ( 0x0001 ) - + /* The stack type changes depending on the data model. */ sp = (cpu_data_t *)&( stk_base[ stk_size - ( uint32_t ) 1 ] ); - sp = ( cpu_data_t * ) ( ( ( cpu_data_t ) sp ) & ( ~( ( cpu_data_t ) PORT_BYTE_ALIGNMENT_MASK ) ) ); - + sp = ( cpu_data_t * ) ( ( ( cpu_data_t ) sp ) & ( ~( ( cpu_data_t ) PORT_BYTE_ALIGNMENT_MASK ) ) ); + /* cpu_data_t is either 16 bits or 32 bits depending on the data model. Some stacked items do not change size depending on the data model so have to be explicitly cast to the correct size so this function will work @@ -207,20 +224,20 @@ __KERNEL__ k_stack_t *cpu_task_stk_init(void *entry, } /* PC - Interrupt return pointer */ - *pul_top_of_stack = ( uint32_t ) entry; - + *pul_top_of_stack = ( uint32_t ) entry; + pus_top_of_stack = ( uint16_t * ) pul_top_of_stack; pus_top_of_stack--; - + /* R2 - SR.GIE - bit8,golbal interrupt enable */ *pus_top_of_stack = 0x08; - /* SR size is 16-bits */ + /* SR size is 16-bits */ pus_top_of_stack -= ( sizeof( cpu_data_t ) / 2 ); - + /* From here on the size of stacked items depends on the memory model. */ sp = ( cpu_data_t * ) pus_top_of_stack; - + #if 0 // enable for debug *sp = ( cpu_data_t ) 0xffff; sp--; @@ -237,7 +254,7 @@ __KERNEL__ k_stack_t *cpu_task_stk_init(void *entry, *sp = ( cpu_data_t ) 0x9999; sp--; *sp = ( cpu_data_t ) 0x8888; - sp--; + sp--; *sp = ( cpu_data_t ) 0x5555; sp--; *sp = ( cpu_data_t ) 0x6666; @@ -249,8 +266,8 @@ __KERNEL__ k_stack_t *cpu_task_stk_init(void *entry, sp -= 3; *sp = ( cpu_data_t ) arg; sp -= 8;// R11-R4 -#endif - +#endif + return (k_stack_t *)sp; } diff --git a/arch/risc-v/common/tos_cpu.c b/arch/risc-v/common/tos_cpu.c index fa8a1753..639b0338 100644 --- a/arch/risc-v/common/tos_cpu.c +++ b/arch/risc-v/common/tos_cpu.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include #include #ifndef TOS_CFG_IRQ_STK_SIZE diff --git a/arch/risc-v/rv32i/gcc/port_c.c b/arch/risc-v/rv32i/gcc/port_c.c index 2475d426..bedfd991 100644 --- a/arch/risc-v/rv32i/gcc/port_c.c +++ b/arch/risc-v/rv32i/gcc/port_c.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include #include "riscv_port.h" __PORT__ void port_systick_config(uint32_t cycle_per_tick) diff --git a/arch/risc-v/spike/gcc/riscv_port_c.c b/arch/risc-v/spike/gcc/riscv_port_c.c index c42452cd..8c017b88 100644 --- a/arch/risc-v/spike/gcc/riscv_port_c.c +++ b/arch/risc-v/spike/gcc/riscv_port_c.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" __PORT__ void port_cpu_init() { // DO NOTHING diff --git a/board/ALIENTEK-MiniSTM32F103RCT6/BSP/Inc/mcu_init.h b/board/ALIENTEK-MiniSTM32F103RCT6/BSP/Inc/mcu_init.h index 2fb4a26f..6c0b92ca 100644 --- a/board/ALIENTEK-MiniSTM32F103RCT6/BSP/Inc/mcu_init.h +++ b/board/ALIENTEK-MiniSTM32F103RCT6/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32f1xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/ALIENTEK-MiniSTM32F103RCT6/BSP/Src/stm32f1xx_it.c b/board/ALIENTEK-MiniSTM32F103RCT6/BSP/Src/stm32f1xx_it.c index 2c090a4c..e7dc1502 100644 --- a/board/ALIENTEK-MiniSTM32F103RCT6/BSP/Src/stm32f1xx_it.c +++ b/board/ALIENTEK-MiniSTM32F103RCT6/BSP/Src/stm32f1xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f1xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M3 Processor Interruption and Exception Handlers */ +/* Cortex-M3 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. diff --git a/board/ALIENTEK_Apollo_STM32F767/BSP/Inc/mcu_init.h b/board/ALIENTEK_Apollo_STM32F767/BSP/Inc/mcu_init.h index ab243ed0..ced81ed9 100644 --- a/board/ALIENTEK_Apollo_STM32F767/BSP/Inc/mcu_init.h +++ b/board/ALIENTEK_Apollo_STM32F767/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32f7xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/ALIENTEK_Apollo_STM32F767/BSP/Src/stm32f7xx_it.c b/board/ALIENTEK_Apollo_STM32F767/BSP/Src/stm32f7xx_it.c index ea3766ed..aa1e0341 100644 --- a/board/ALIENTEK_Apollo_STM32F767/BSP/Src/stm32f7xx_it.c +++ b/board/ALIENTEK_Apollo_STM32F767/BSP/Src/stm32f7xx_it.c @@ -34,7 +34,7 @@ #include "stm32f7xx_hal.h" #include "stm32f7xx.h" #include "stm32f7xx_it.h" -#include "tos.h" +#include "tos_k.h" /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ @@ -42,7 +42,7 @@ /* External variables --------------------------------------------------------*/ /******************************************************************************/ -/* Cortex-M7 Processor Interruption and Exception Handlers */ +/* Cortex-M7 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** diff --git a/board/ALIENTEK_Apollo_STM32F767/BSP/Src/tickless/bsp_pm_device.c b/board/ALIENTEK_Apollo_STM32F767/BSP/Src/tickless/bsp_pm_device.c index dbbbc4d0..bc95c813 100644 --- a/board/ALIENTEK_Apollo_STM32F767/BSP/Src/tickless/bsp_pm_device.c +++ b/board/ALIENTEK_Apollo_STM32F767/BSP/Src/tickless/bsp_pm_device.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #if TOS_CFG_PWR_MGR_EN > 0u diff --git a/board/ALIENTEK_Apollo_STM32F767/BSP/Src/tickless/bsp_pwr_mgr.c b/board/ALIENTEK_Apollo_STM32F767/BSP/Src/tickless/bsp_pwr_mgr.c index 46c2ed69..a8df35a8 100644 --- a/board/ALIENTEK_Apollo_STM32F767/BSP/Src/tickless/bsp_pwr_mgr.c +++ b/board/ALIENTEK_Apollo_STM32F767/BSP/Src/tickless/bsp_pwr_mgr.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tickless/bsp_pm_device.h" #include "tickless/bsp_tickless_alarm.h" diff --git a/board/ALIENTEK_Apollo_STM32F767/BSP/Src/tickless/bsp_tickless_alarm.c b/board/ALIENTEK_Apollo_STM32F767/BSP/Src/tickless/bsp_tickless_alarm.c index ff5a0df4..5ec904a3 100644 --- a/board/ALIENTEK_Apollo_STM32F767/BSP/Src/tickless/bsp_tickless_alarm.c +++ b/board/ALIENTEK_Apollo_STM32F767/BSP/Src/tickless/bsp_tickless_alarm.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "stm32f7xx_hal.h" #include "stm32f7xx_hal_tim.h" @@ -159,7 +159,7 @@ static HAL_StatusTypeDef tickless_rtc_time_set(uint8_t hour, uint8_t minu, uint8 rtc_time.TimeFormat = format; rtc_time.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; rtc_time.StoreOperation = RTC_STOREOPERATION_RESET; - return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN); + return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN); } static HAL_StatusTypeDef tickless_rtc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week) @@ -256,7 +256,7 @@ void HAL_RTC_MspInit(RTC_HandleTypeDef *rtc_handler) void RTC_WKUP_IRQHandler(void) { - HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler); + HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler); } void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *rtc_handler) @@ -333,11 +333,11 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond) // __HAL_PWR_GET_FLAG(PWR_FLAG_WU) - __HAL_RCC_AHB1_FORCE_RESET(); //复位所有IO口 + __HAL_RCC_AHB1_FORCE_RESET(); //复位所有IO口 __HAL_RCC_PWR_CLK_ENABLE(); //使能PWR时钟 // __HAL_RCC_BACKUPRESET_FORCE(); //复位备份区域 - HAL_PWR_EnableBkUpAccess(); //后备区域访问使能 + HAL_PWR_EnableBkUpAccess(); //后备区域访问使能 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB); __HAL_RTC_WRITEPROTECTION_DISABLE(&rtc_handler);//关闭RTC写保护 @@ -351,7 +351,7 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond) //清除RTC相关中断标志位 __HAL_RTC_ALARM_CLEAR_FLAG(&rtc_handler,RTC_FLAG_ALRAF|RTC_FLAG_ALRBF); - __HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF); + __HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF); __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&rtc_handler,RTC_FLAG_WUTF); // __HAL_RCC_BACKUPRESET_RELEASE(); //备份区域复位结束 diff --git a/board/ALIENTEK_EXPLORER_STM32F407ZGT6/BSP/Inc/mcu_init.h b/board/ALIENTEK_EXPLORER_STM32F407ZGT6/BSP/Inc/mcu_init.h index f4212ae9..8a4112e1 100644 --- a/board/ALIENTEK_EXPLORER_STM32F407ZGT6/BSP/Inc/mcu_init.h +++ b/board/ALIENTEK_EXPLORER_STM32F407ZGT6/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32f4xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/ALIENTEK_EXPLORER_STM32F407ZGT6/BSP/Src/stm32f4xx_it.c b/board/ALIENTEK_EXPLORER_STM32F407ZGT6/BSP/Src/stm32f4xx_it.c index 6547384a..736999f2 100644 --- a/board/ALIENTEK_EXPLORER_STM32F407ZGT6/BSP/Src/stm32f4xx_it.c +++ b/board/ALIENTEK_EXPLORER_STM32F407ZGT6/BSP/Src/stm32f4xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f4xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ extern UART_HandleTypeDef huart1; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -186,11 +186,11 @@ void SysTick_Handler(void) /* USER CODE END SysTick_IRQn 0 */ HAL_IncTick(); - if(tos_knl_is_running()) + if(tos_knl_is_running()) { - tos_knl_irq_enter(); - tos_tick_handler(); - tos_knl_irq_leave(); + tos_knl_irq_enter(); + tos_tick_handler(); + tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/ALIENTEK_Elite_STM32F103ZET6/BSP/Inc/mcu_init.h b/board/ALIENTEK_Elite_STM32F103ZET6/BSP/Inc/mcu_init.h index 2fb4a26f..6c0b92ca 100644 --- a/board/ALIENTEK_Elite_STM32F103ZET6/BSP/Inc/mcu_init.h +++ b/board/ALIENTEK_Elite_STM32F103ZET6/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32f1xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/ALIENTEK_Elite_STM32F103ZET6/BSP/Src/stm32f1xx_it.c b/board/ALIENTEK_Elite_STM32F103ZET6/BSP/Src/stm32f1xx_it.c index 95fd3f08..14c31445 100644 --- a/board/ALIENTEK_Elite_STM32F103ZET6/BSP/Src/stm32f1xx_it.c +++ b/board/ALIENTEK_Elite_STM32F103ZET6/BSP/Src/stm32f1xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f1xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ extern UART_HandleTypeDef huart1; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M3 Processor Interruption and Exception Handlers */ +/* Cortex-M3 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. diff --git a/board/ALIENTEK_Pandora_STM32L475/BSP/Inc/mcu_init.h b/board/ALIENTEK_Pandora_STM32L475/BSP/Inc/mcu_init.h index 952611ae..d9b428c0 100644 --- a/board/ALIENTEK_Pandora_STM32L475/BSP/Inc/mcu_init.h +++ b/board/ALIENTEK_Pandora_STM32L475/BSP/Inc/mcu_init.h @@ -10,7 +10,7 @@ extern "C" { #include "usart.h" #include "gpio.h" #include "spi.h" -#include "tos.h" +#include "tos_k.h" #include "lcd.h" void board_init(void); diff --git a/board/ALIENTEK_Pandora_STM32L475/BSP/Src/stm32l4xx_it.c b/board/ALIENTEK_Pandora_STM32L475/BSP/Src/stm32l4xx_it.c index eab72d68..a5a6c57f 100644 --- a/board/ALIENTEK_Pandora_STM32L475/BSP/Src/stm32l4xx_it.c +++ b/board/ALIENTEK_Pandora_STM32L475/BSP/Src/stm32l4xx_it.c @@ -23,7 +23,7 @@ #include "stm32l4xx_it.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ -#include "tos.h" +#include "tos_k.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN TD */ @@ -32,7 +32,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -62,7 +62,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. diff --git a/board/ALIENTEK_STM32F429/BSP/Inc/mcu_init.h b/board/ALIENTEK_STM32F429/BSP/Inc/mcu_init.h index 5e6a5739..d1720d8d 100644 --- a/board/ALIENTEK_STM32F429/BSP/Inc/mcu_init.h +++ b/board/ALIENTEK_STM32F429/BSP/Inc/mcu_init.h @@ -13,7 +13,7 @@ #include "usart.h" #include "gpio.h" #include "rng.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/ALIENTEK_STM32F429/BSP/Src/bsp_eth.c b/board/ALIENTEK_STM32F429/BSP/Src/bsp_eth.c index b0af6875..ce017906 100644 --- a/board/ALIENTEK_STM32F429/BSP/Src/bsp_eth.c +++ b/board/ALIENTEK_STM32F429/BSP/Src/bsp_eth.c @@ -20,7 +20,7 @@ /* Includes ------------------------------------------------------------------*/ #include "bsp_eth.h" #include "main.h" -#include "tos.h" +#include "tos_k.h" #include "lwip/opt.h" #include "lwip/timeouts.h" #include "netif/ethernet.h" diff --git a/board/ALIENTEK_STM32F429/BSP/Src/stm32f4xx_it.c b/board/ALIENTEK_STM32F429/BSP/Src/stm32f4xx_it.c index 2c30a4cd..db26fe9c 100644 --- a/board/ALIENTEK_STM32F429/BSP/Src/stm32f4xx_it.c +++ b/board/ALIENTEK_STM32F429/BSP/Src/stm32f4xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f4xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ extern UART_HandleTypeDef huart1; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -175,8 +175,8 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); - tos_knl_irq_leave(); + tos_tick_handler(); + tos_knl_irq_leave(); } //HAL_SYSTICK_IRQHandler(); /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/ALIENTEK_STM32F429/BSP/Src/tickless/bsp_pm_device.c b/board/ALIENTEK_STM32F429/BSP/Src/tickless/bsp_pm_device.c index dbbbc4d0..bc95c813 100644 --- a/board/ALIENTEK_STM32F429/BSP/Src/tickless/bsp_pm_device.c +++ b/board/ALIENTEK_STM32F429/BSP/Src/tickless/bsp_pm_device.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #if TOS_CFG_PWR_MGR_EN > 0u diff --git a/board/ALIENTEK_STM32F429/BSP/Src/tickless/bsp_pwr_mgr.c b/board/ALIENTEK_STM32F429/BSP/Src/tickless/bsp_pwr_mgr.c index 46c2ed69..a8df35a8 100644 --- a/board/ALIENTEK_STM32F429/BSP/Src/tickless/bsp_pwr_mgr.c +++ b/board/ALIENTEK_STM32F429/BSP/Src/tickless/bsp_pwr_mgr.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tickless/bsp_pm_device.h" #include "tickless/bsp_tickless_alarm.h" diff --git a/board/ALIENTEK_STM32F429/BSP/Src/tickless/bsp_tickless_alarm.c b/board/ALIENTEK_STM32F429/BSP/Src/tickless/bsp_tickless_alarm.c index 9d2342d8..c4d881f0 100644 --- a/board/ALIENTEK_STM32F429/BSP/Src/tickless/bsp_tickless_alarm.c +++ b/board/ALIENTEK_STM32F429/BSP/Src/tickless/bsp_tickless_alarm.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "stm32f4xx_hal.h" #include "stm32f4xx_hal_tim.h" @@ -158,7 +158,7 @@ static HAL_StatusTypeDef tickless_rtc_time_set(uint8_t hour, uint8_t minu, uint8 rtc_time.TimeFormat = format; rtc_time.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; rtc_time.StoreOperation = RTC_STOREOPERATION_RESET; - return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN); + return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN); } static HAL_StatusTypeDef tickless_rtc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week) @@ -255,7 +255,7 @@ void HAL_RTC_MspInit(RTC_HandleTypeDef *rtc_handler) void RTC_WKUP_IRQHandler(void) { - HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler); + HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler); } void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *rtc_handler) @@ -332,11 +332,11 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond) // __HAL_PWR_GET_FLAG(PWR_FLAG_WU) - __HAL_RCC_AHB1_FORCE_RESET(); //复位所有IO口 + __HAL_RCC_AHB1_FORCE_RESET(); //复位所有IO口 __HAL_RCC_PWR_CLK_ENABLE(); //使能PWR时钟 // __HAL_RCC_BACKUPRESET_FORCE(); //复位备份区域 - HAL_PWR_EnableBkUpAccess(); //后备区域访问使能 + HAL_PWR_EnableBkUpAccess(); //后备区域访问使能 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB); __HAL_RTC_WRITEPROTECTION_DISABLE(&rtc_handler);//关闭RTC写保护 @@ -350,7 +350,7 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond) //清除RTC相关中断标志位 __HAL_RTC_ALARM_CLEAR_FLAG(&rtc_handler,RTC_FLAG_ALRAF|RTC_FLAG_ALRBF); - __HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF); + __HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF); __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&rtc_handler,RTC_FLAG_WUTF); // __HAL_RCC_BACKUPRESET_RELEASE(); //备份区域复位结束 diff --git a/board/ALIENTEK_WarShip_STM32F103ZET6/BSP/Inc/mcu_init.h b/board/ALIENTEK_WarShip_STM32F103ZET6/BSP/Inc/mcu_init.h index 2fb4a26f..6c0b92ca 100644 --- a/board/ALIENTEK_WarShip_STM32F103ZET6/BSP/Inc/mcu_init.h +++ b/board/ALIENTEK_WarShip_STM32F103ZET6/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32f1xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/ALIENTEK_WarShip_STM32F103ZET6/BSP/Src/stm32f1xx_it.c b/board/ALIENTEK_WarShip_STM32F103ZET6/BSP/Src/stm32f1xx_it.c index 95fd3f08..14c31445 100644 --- a/board/ALIENTEK_WarShip_STM32F103ZET6/BSP/Src/stm32f1xx_it.c +++ b/board/ALIENTEK_WarShip_STM32F103ZET6/BSP/Src/stm32f1xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f1xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ extern UART_HandleTypeDef huart1; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M3 Processor Interruption and Exception Handlers */ +/* Cortex-M3 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. diff --git a/board/BearPi_STM32L431RC/BSP/Inc/mcu_init.h b/board/BearPi_STM32L431RC/BSP/Inc/mcu_init.h index 5772ab79..962bb289 100644 --- a/board/BearPi_STM32L431RC/BSP/Inc/mcu_init.h +++ b/board/BearPi_STM32L431RC/BSP/Inc/mcu_init.h @@ -12,7 +12,7 @@ #include "gpio.h" #include "lcd_spi2_drv.h" #include "bh1750.h" -#include "tos.h" +#include "tos_k.h" void m26_power_on(void); void board_init(void); diff --git a/board/BearPi_STM32L431RC/BSP/Src/stm32l4xx_it.c b/board/BearPi_STM32L431RC/BSP/Src/stm32l4xx_it.c index 6556bc9a..8c8c5f5a 100644 --- a/board/BearPi_STM32L431RC/BSP/Src/stm32l4xx_it.c +++ b/board/BearPi_STM32L431RC/BSP/Src/stm32l4xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l4xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -65,7 +65,7 @@ extern UART_HandleTypeDef huart3; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. diff --git a/board/BearPi_STM32L431RC/BSP/Src/stm32l4xx_it_module.c b/board/BearPi_STM32L431RC/BSP/Src/stm32l4xx_it_module.c index 517f19ae..0d2069c2 100644 --- a/board/BearPi_STM32L431RC/BSP/Src/stm32l4xx_it_module.c +++ b/board/BearPi_STM32L431RC/BSP/Src/stm32l4xx_it_module.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l4xx_it.h" -#include "tos.h" +#include "tos_k.h" #include "tos_at.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ @@ -34,7 +34,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -66,7 +66,7 @@ extern UART_HandleTypeDef huart3; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. diff --git a/board/BearPi_STM32L431RC/BSP/Src/tickless/bsp_pm_device.c b/board/BearPi_STM32L431RC/BSP/Src/tickless/bsp_pm_device.c index dbbbc4d0..bc95c813 100644 --- a/board/BearPi_STM32L431RC/BSP/Src/tickless/bsp_pm_device.c +++ b/board/BearPi_STM32L431RC/BSP/Src/tickless/bsp_pm_device.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #if TOS_CFG_PWR_MGR_EN > 0u diff --git a/board/BearPi_STM32L431RC/BSP/Src/tickless/bsp_pwr_mgr.c b/board/BearPi_STM32L431RC/BSP/Src/tickless/bsp_pwr_mgr.c index 46c2ed69..a8df35a8 100644 --- a/board/BearPi_STM32L431RC/BSP/Src/tickless/bsp_pwr_mgr.c +++ b/board/BearPi_STM32L431RC/BSP/Src/tickless/bsp_pwr_mgr.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tickless/bsp_pm_device.h" #include "tickless/bsp_tickless_alarm.h" diff --git a/board/BearPi_STM32L431RC/BSP/Src/tickless/bsp_tickless_alarm.c b/board/BearPi_STM32L431RC/BSP/Src/tickless/bsp_tickless_alarm.c index 43b28a37..99c31edb 100644 --- a/board/BearPi_STM32L431RC/BSP/Src/tickless/bsp_tickless_alarm.c +++ b/board/BearPi_STM32L431RC/BSP/Src/tickless/bsp_tickless_alarm.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "stm32l4xx_hal.h" #include "stm32l4xx_hal_tim.h" @@ -96,7 +96,7 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *tim_handler) /* TIM6 interrupt Deinit */ HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn); } -} +} static int tickless_tim6_wkup_alarm_init(void) { @@ -177,7 +177,7 @@ static HAL_StatusTypeDef tickless_rtc_time_set(uint8_t hour, uint8_t minu, uint8 rtc_time.TimeFormat = format; rtc_time.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; rtc_time.StoreOperation = RTC_STOREOPERATION_RESET; - return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN); + return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN); } static HAL_StatusTypeDef tickless_rtc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week) @@ -274,7 +274,7 @@ void HAL_RTC_MspInit(RTC_HandleTypeDef *rtc_handler) void RTC_WKUP_IRQHandler(void) { - HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler); + HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler); } void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *rtc_handler) @@ -355,11 +355,11 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond) // __HAL_PWR_GET_FLAG(PWR_FLAG_WU) - __HAL_RCC_AHB1_FORCE_RESET(); //复位所有IO口 + __HAL_RCC_AHB1_FORCE_RESET(); //复位所有IO口 __HAL_RCC_PWR_CLK_ENABLE(); //使能PWR时钟 // __HAL_RCC_BACKUPRESET_FORCE(); //复位备份区域 - HAL_PWR_EnableBkUpAccess(); //后备区域访问使能 + HAL_PWR_EnableBkUpAccess(); //后备区域访问使能 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB); __HAL_RTC_WRITEPROTECTION_DISABLE(&rtc_handler);//关闭RTC写保护 @@ -373,7 +373,7 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond) //清除RTC相关中断标志位 __HAL_RTC_ALARM_CLEAR_FLAG(&rtc_handler,RTC_FLAG_ALRAF|RTC_FLAG_ALRBF); - __HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF); + __HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF); __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&rtc_handler,RTC_FLAG_WUTF); // __HAL_RCC_BACKUPRESET_RELEASE(); //备份区域复位结束 diff --git a/board/Fire_STM32F103VEtx/BSP/Inc/mcu_init.h b/board/Fire_STM32F103VEtx/BSP/Inc/mcu_init.h index 67fe181a..bea64163 100644 --- a/board/Fire_STM32F103VEtx/BSP/Inc/mcu_init.h +++ b/board/Fire_STM32F103VEtx/BSP/Inc/mcu_init.h @@ -13,7 +13,7 @@ #include "usart.h" #include "usb.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/Fire_STM32F103VEtx/BSP/Src/stm32f1xx_it.c b/board/Fire_STM32F103VEtx/BSP/Src/stm32f1xx_it.c index c07127fa..d561ee36 100644 --- a/board/Fire_STM32F103VEtx/BSP/Src/stm32f1xx_it.c +++ b/board/Fire_STM32F103VEtx/BSP/Src/stm32f1xx_it.c @@ -34,7 +34,7 @@ #include "stm32f1xx_hal.h" #include "stm32f1xx.h" #include "stm32f1xx_it.h" -#include "tos.h" +#include "tos_k.h" #include "usart.h" /* USER CODE BEGIN 0 */ @@ -47,7 +47,7 @@ extern UART_HandleTypeDef huart2; extern UART_HandleTypeDef huart3; /******************************************************************************/ -/* Cortex-M3 Processor Interruption and Exception Handlers */ +/* Cortex-M3 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** diff --git a/board/GigaDevice_GD32450i_EVAL/BSP/Src/gd32f4xx_it.c b/board/GigaDevice_GD32450i_EVAL/BSP/Src/gd32f4xx_it.c index d4cd6348..10d1ca16 100644 --- a/board/GigaDevice_GD32450i_EVAL/BSP/Src/gd32f4xx_it.c +++ b/board/GigaDevice_GD32450i_EVAL/BSP/Src/gd32f4xx_it.c @@ -12,7 +12,7 @@ #include "gd32f4xx_it.h" #include "main.h" #include "systick.h" -#include "tos.h" +#include "tos_k.h" /*! \brief this function handles NMI exception @@ -117,7 +117,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } delay_decrement(); diff --git a/board/GigaDevice_GD32E103V_EVAL/BSP/Src/gd32e10x_it.c b/board/GigaDevice_GD32E103V_EVAL/BSP/Src/gd32e10x_it.c index 402f9b11..8c97eddd 100644 --- a/board/GigaDevice_GD32E103V_EVAL/BSP/Src/gd32e10x_it.c +++ b/board/GigaDevice_GD32E103V_EVAL/BSP/Src/gd32e10x_it.c @@ -1,7 +1,7 @@ /*! \file gd32e10x_it.c \brief interrupt service routines - + \version 2018-03-26, V1.0.0, demo for GD32E103 */ @@ -10,33 +10,33 @@ All rights reserved. - Redistribution and use in source and binary forms, with or without modification, + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, this + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software without + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "gd32e10x_it.h" #include "systick.h" -#include "tos.h" +#include "tos_k.h" /*! \brief this function handles NMI exception \param[in] none @@ -131,7 +131,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } delay_decrement(); diff --git a/board/GigaDevice_GD32E230C_START/BSP/Src/gd32e23x_it.c b/board/GigaDevice_GD32E230C_START/BSP/Src/gd32e23x_it.c index df9b2caf..fbe403ab 100644 --- a/board/GigaDevice_GD32E230C_START/BSP/Src/gd32e23x_it.c +++ b/board/GigaDevice_GD32E230C_START/BSP/Src/gd32e23x_it.c @@ -1,7 +1,7 @@ /*! \file gd32e23x_it.c \brief interrupt service routines - + \version 2019-02-19, V1.0.0, firmware for GD32E23x */ @@ -10,33 +10,33 @@ All rights reserved. - Redistribution and use in source and binary forms, with or without modification, + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, this + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software without + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "gd32e23x_it.h" #include "systick.h" -#include "tos.h" +#include "tos_k.h" /*! \brief this function handles NMI exception \param[in] none @@ -132,7 +132,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) //OS开始跑了,才执行正常的调度处理 { tos_knl_irq_enter(); //进入中断 - tos_tick_handler(); //调用TencentOS tiny的时钟服务程序 + tos_tick_handler(); //调用TencentOS tiny的时钟服务程序 tos_knl_irq_leave(); //触发任务切换软中断 } delay_decrement(); diff --git a/board/GigaDevice_GD32F130C_START/BSP/Src/gd32f1x0_it.c b/board/GigaDevice_GD32F130C_START/BSP/Src/gd32f1x0_it.c index 76578470..546930b0 100644 --- a/board/GigaDevice_GD32F130C_START/BSP/Src/gd32f1x0_it.c +++ b/board/GigaDevice_GD32F130C_START/BSP/Src/gd32f1x0_it.c @@ -15,7 +15,7 @@ #include "gd32f1x0_it.h" #include "main.h" #include "systick.h" -#include "tos.h" +#include "tos_k.h" /*! \brief this function handles NMI exception \param[in] none @@ -110,7 +110,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } delay_decrement(); diff --git a/board/GigaDevice_GD32F207ZET6/BSP/Src/gd32f20x_it.c b/board/GigaDevice_GD32F207ZET6/BSP/Src/gd32f20x_it.c index f40df607..a541b12e 100644 --- a/board/GigaDevice_GD32F207ZET6/BSP/Src/gd32f20x_it.c +++ b/board/GigaDevice_GD32F207ZET6/BSP/Src/gd32f20x_it.c @@ -12,34 +12,34 @@ All rights reserved. - Redistribution and use in source and binary forms, with or without modification, + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, this + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software without + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "gd32f20x_it.h" #include "main.h" #include "systick.h" -#include "tos.h" +#include "tos_k.h" /*! \brief this function handles NMI exception \param[in] none @@ -143,7 +143,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) //OS开始跑了,才执行正常的调度处理 { tos_knl_irq_enter(); //进入中断 - tos_tick_handler(); //调用TencentOS tiny的时钟服务程序 + tos_tick_handler(); //调用TencentOS tiny的时钟服务程序 tos_knl_irq_leave(); //触发任务切换软中断 } delay_decrement(); diff --git a/board/GigaDevice_GD32F303C_START/BSP/Src/gd32f30x_it.c b/board/GigaDevice_GD32F303C_START/BSP/Src/gd32f30x_it.c index c71ae5b3..d764d208 100644 --- a/board/GigaDevice_GD32F303C_START/BSP/Src/gd32f30x_it.c +++ b/board/GigaDevice_GD32F303C_START/BSP/Src/gd32f30x_it.c @@ -12,34 +12,34 @@ All rights reserved. - Redistribution and use in source and binary forms, with or without modification, + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, this + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software without + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without specific prior written permission. - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "gd32f30x_it.h" #include "main.h" #include "systick.h" -#include "tos.h" +#include "tos_k.h" /*! \brief this function handles NMI exception \param[in] none @@ -134,7 +134,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } delay_decrement(); diff --git a/board/GigaDevice_GD32VF103C_EVAL/BSP/Src/gd32vf103_it.c b/board/GigaDevice_GD32VF103C_EVAL/BSP/Src/gd32vf103_it.c index aa33583b..953c2f64 100644 --- a/board/GigaDevice_GD32VF103C_EVAL/BSP/Src/gd32vf103_it.c +++ b/board/GigaDevice_GD32VF103C_EVAL/BSP/Src/gd32vf103_it.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" // systick handler void eclic_mtip_handler() { diff --git a/board/GigaDevice_GD32VF103C_EVAL/eclipse/hello_world/main.c b/board/GigaDevice_GD32VF103C_EVAL/eclipse/hello_world/main.c index 08a84995..7bc66b33 100644 --- a/board/GigaDevice_GD32VF103C_EVAL/eclipse/hello_world/main.c +++ b/board/GigaDevice_GD32VF103C_EVAL/eclipse/hello_world/main.c @@ -1,5 +1,5 @@ #include "mcu_init.h" -#include "tos.h" +#include "tos_k.h" #define TASK_SIZE 1024 k_task_t k_task_task1; diff --git a/board/GigaDevice_GD32VF103C_START/BSP/Src/gd32vf103_it.c b/board/GigaDevice_GD32VF103C_START/BSP/Src/gd32vf103_it.c index aa33583b..953c2f64 100644 --- a/board/GigaDevice_GD32VF103C_START/BSP/Src/gd32vf103_it.c +++ b/board/GigaDevice_GD32VF103C_START/BSP/Src/gd32vf103_it.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" // systick handler void eclic_mtip_handler() { diff --git a/board/GigaDevice_GD32VF103C_START/eclipse/hello_world/main.c b/board/GigaDevice_GD32VF103C_START/eclipse/hello_world/main.c index 7e362a6a..dd8bdcb2 100644 --- a/board/GigaDevice_GD32VF103C_START/eclipse/hello_world/main.c +++ b/board/GigaDevice_GD32VF103C_START/eclipse/hello_world/main.c @@ -1,5 +1,5 @@ #include "mcu_init.h" -#include "tos.h" +#include "tos_k.h" #define TASK_SIZE 1024 k_task_t k_task_task1; diff --git a/board/LTE_DTU_SIM7600/BSP/Inc/mcu_init.h b/board/LTE_DTU_SIM7600/BSP/Inc/mcu_init.h index 2556ec92..c5d6230b 100644 --- a/board/LTE_DTU_SIM7600/BSP/Inc/mcu_init.h +++ b/board/LTE_DTU_SIM7600/BSP/Inc/mcu_init.h @@ -9,7 +9,7 @@ #include "i2c.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/LTE_DTU_SIM7600/BSP/Inc/tos_at.h b/board/LTE_DTU_SIM7600/BSP/Inc/tos_at.h index 109f5300..f57b01d4 100644 --- a/board/LTE_DTU_SIM7600/BSP/Inc/tos_at.h +++ b/board/LTE_DTU_SIM7600/BSP/Inc/tos_at.h @@ -18,7 +18,7 @@ #ifndef _TOS_AT_H_ #define _TOS_AT_H_ -#include "tos.h" +#include "tos_k.h" #include "tos_at_utils.h" #include "tos_hal.h" @@ -268,7 +268,7 @@ int tos_at_init(hal_uart_port_t uart_port, at_event_t *event_table, size_t event * * @attention None * - * @return + * @return None */ void tos_at_deinit(void); diff --git a/board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_it.c b/board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_it.c index 446faab2..e05b6e7c 100644 --- a/board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_it.c +++ b/board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f1xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -65,7 +65,7 @@ extern UART_HandleTypeDef huart3; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M3 Processor Interruption and Exception Handlers */ +/* Cortex-M3 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -190,8 +190,8 @@ void SysTick_Handler(void) HAL_IncTick(); if(tos_knl_is_running()) { - tos_knl_irq_enter(); - tos_tick_handler(); + tos_knl_irq_enter(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_it_module.c b/board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_it_module.c index 86b92f9d..f409653f 100644 --- a/board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_it_module.c +++ b/board/LTE_DTU_SIM7600/BSP/Src/stm32f1xx_it_module.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f1xx_it.h" -#include "tos.h" +#include "tos_k.h" #include "tos_at.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ @@ -34,7 +34,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -66,7 +66,7 @@ extern UART_HandleTypeDef huart3; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M3 Processor Interruption and Exception Handlers */ +/* Cortex-M3 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -191,8 +191,8 @@ void SysTick_Handler(void) HAL_IncTick(); if(tos_knl_is_running()) { - tos_knl_irq_enter(); - tos_tick_handler(); + tos_knl_irq_enter(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/N32G020K8_TB_V11/tencent_os_mqtt/src/n32g020xx_it.c b/board/N32G020K8_TB_V11/tencent_os_mqtt/src/n32g020xx_it.c index 422e2289..0dc5c3a6 100644 --- a/board/N32G020K8_TB_V11/tencent_os_mqtt/src/n32g020xx_it.c +++ b/board/N32G020K8_TB_V11/tencent_os_mqtt/src/n32g020xx_it.c @@ -34,7 +34,7 @@ #include "n32g020xx_log.h" #include "tos_at.h" /* USER CODE BEGIN 0 */ -#include +#include /* USER CODE END 0 */ @@ -98,7 +98,7 @@ void SysTick_Handler(void) { /* USER CODE END SysTick_IRQn 1 */ } -void AT_UART_DataParse(char byte) +void AT_UART_DataParse(char byte) { tos_at_uart_write_byte(byte); } diff --git a/board/NUCLEO_STM32F072RB/BSP/Inc/mcu_init.h b/board/NUCLEO_STM32F072RB/BSP/Inc/mcu_init.h index 7e8f43d3..65441d74 100644 --- a/board/NUCLEO_STM32F072RB/BSP/Inc/mcu_init.h +++ b/board/NUCLEO_STM32F072RB/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32f0xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/NUCLEO_STM32F072RB/BSP/Src/stm32f0xx_it.c b/board/NUCLEO_STM32F072RB/BSP/Src/stm32f0xx_it.c index 3506e8cb..547150e0 100644 --- a/board/NUCLEO_STM32F072RB/BSP/Src/stm32f0xx_it.c +++ b/board/NUCLEO_STM32F072RB/BSP/Src/stm32f0xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f0xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M0 Processor Interruption and Exception Handlers */ +/* Cortex-M0 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -131,7 +131,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32F103RB/BSP/Inc/mcu_init.h b/board/NUCLEO_STM32F103RB/BSP/Inc/mcu_init.h index 2fb4a26f..6c0b92ca 100644 --- a/board/NUCLEO_STM32F103RB/BSP/Inc/mcu_init.h +++ b/board/NUCLEO_STM32F103RB/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32f1xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/NUCLEO_STM32F103RB/BSP/Src/stm32f1xx_it.c b/board/NUCLEO_STM32F103RB/BSP/Src/stm32f1xx_it.c index 4025f79d..e1a2d151 100644 --- a/board/NUCLEO_STM32F103RB/BSP/Src/stm32f1xx_it.c +++ b/board/NUCLEO_STM32F103RB/BSP/Src/stm32f1xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f1xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M3 Processor Interruption and Exception Handlers */ +/* Cortex-M3 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -188,8 +188,8 @@ void SysTick_Handler(void) HAL_IncTick(); if(tos_knl_is_running()) { - tos_knl_irq_enter(); - tos_tick_handler(); + tos_knl_irq_enter(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32F401RE/BSP/Inc/mcu_init.h b/board/NUCLEO_STM32F401RE/BSP/Inc/mcu_init.h index f4212ae9..8a4112e1 100644 --- a/board/NUCLEO_STM32F401RE/BSP/Inc/mcu_init.h +++ b/board/NUCLEO_STM32F401RE/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32f4xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/NUCLEO_STM32F401RE/BSP/Src/stm32f4xx_it.c b/board/NUCLEO_STM32F401RE/BSP/Src/stm32f4xx_it.c index efd03654..1fb80886 100644 --- a/board/NUCLEO_STM32F401RE/BSP/Src/stm32f4xx_it.c +++ b/board/NUCLEO_STM32F401RE/BSP/Src/stm32f4xx_it.c @@ -23,7 +23,7 @@ #include "stm32f4xx_it.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ -#include "tos.h" +#include "tos_k.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -189,7 +189,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32F746ZG/BSP/Inc/mcu_init.h b/board/NUCLEO_STM32F746ZG/BSP/Inc/mcu_init.h index b8c44e84..dd0c6647 100644 --- a/board/NUCLEO_STM32F746ZG/BSP/Inc/mcu_init.h +++ b/board/NUCLEO_STM32F746ZG/BSP/Inc/mcu_init.h @@ -10,7 +10,7 @@ #include "gpio.h" #include "bsp_eth.h" #include "usb_otg.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/NUCLEO_STM32F746ZG/BSP/Src/bsp_eth.c b/board/NUCLEO_STM32F746ZG/BSP/Src/bsp_eth.c index 6ab3bb68..230e9bd1 100644 --- a/board/NUCLEO_STM32F746ZG/BSP/Src/bsp_eth.c +++ b/board/NUCLEO_STM32F746ZG/BSP/Src/bsp_eth.c @@ -20,7 +20,7 @@ /* Includes ------------------------------------------------------------------*/ #include "bsp_eth.h" #include "main.h" -#include "tos.h" +#include "tos_k.h" #include "lwip/opt.h" #include "lwip/timeouts.h" #include "netif/ethernet.h" diff --git a/board/NUCLEO_STM32F746ZG/BSP/Src/iperf.c b/board/NUCLEO_STM32F746ZG/BSP/Src/iperf.c index c1458e95..f20fded1 100644 --- a/board/NUCLEO_STM32F746ZG/BSP/Src/iperf.c +++ b/board/NUCLEO_STM32F746ZG/BSP/Src/iperf.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include #include diff --git a/board/NUCLEO_STM32F746ZG/BSP/Src/stm32f7xx_it.c b/board/NUCLEO_STM32F746ZG/BSP/Src/stm32f7xx_it.c index 924b52ab..174e8ba6 100644 --- a/board/NUCLEO_STM32F746ZG/BSP/Src/stm32f7xx_it.c +++ b/board/NUCLEO_STM32F746ZG/BSP/Src/stm32f7xx_it.c @@ -21,11 +21,11 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f7xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ - + /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN TD */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -64,7 +64,7 @@ extern ETH_HandleTypeDef heth; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M7 Processor Interruption and Exception Handlers */ +/* Cortex-M7 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -190,7 +190,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32F746ZG/BSP/Src/stm32f7xx_it_noeth.c b/board/NUCLEO_STM32F746ZG/BSP/Src/stm32f7xx_it_noeth.c index c2d13f03..88443932 100644 --- a/board/NUCLEO_STM32F746ZG/BSP/Src/stm32f7xx_it_noeth.c +++ b/board/NUCLEO_STM32F746ZG/BSP/Src/stm32f7xx_it_noeth.c @@ -21,11 +21,11 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f7xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ - + /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN TD */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -64,7 +64,7 @@ extern ETH_HandleTypeDef heth; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M7 Processor Interruption and Exception Handlers */ +/* Cortex-M7 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -190,7 +190,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32G070RB/BSP/Inc/mcu_init.h b/board/NUCLEO_STM32G070RB/BSP/Inc/mcu_init.h index 825f962d..a7025b1c 100644 --- a/board/NUCLEO_STM32G070RB/BSP/Inc/mcu_init.h +++ b/board/NUCLEO_STM32G070RB/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32g0xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/NUCLEO_STM32G070RB/BSP/Src/stm32g0xx_it.c b/board/NUCLEO_STM32G070RB/BSP/Src/stm32g0xx_it.c index e3b416b3..9f9f8f35 100644 --- a/board/NUCLEO_STM32G070RB/BSP/Src/stm32g0xx_it.c +++ b/board/NUCLEO_STM32G070RB/BSP/Src/stm32g0xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32g0xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M0+ Processor Interruption and Exception Handlers */ +/* Cortex-M0+ Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -131,7 +131,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32G071RB/BSP/Inc/mcu_init.h b/board/NUCLEO_STM32G071RB/BSP/Inc/mcu_init.h index 825f962d..a7025b1c 100644 --- a/board/NUCLEO_STM32G071RB/BSP/Inc/mcu_init.h +++ b/board/NUCLEO_STM32G071RB/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32g0xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/NUCLEO_STM32G071RB/BSP/Src/stm32g0xx_it.c b/board/NUCLEO_STM32G071RB/BSP/Src/stm32g0xx_it.c index a1f4ec95..964e0098 100644 --- a/board/NUCLEO_STM32G071RB/BSP/Src/stm32g0xx_it.c +++ b/board/NUCLEO_STM32G071RB/BSP/Src/stm32g0xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32g0xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M0+ Processor Interruption and Exception Handlers */ +/* Cortex-M0+ Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -131,7 +131,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32L053R8/BSP/Inc/mcu_init.h b/board/NUCLEO_STM32L053R8/BSP/Inc/mcu_init.h index b54476b1..1c2ba1b6 100644 --- a/board/NUCLEO_STM32L053R8/BSP/Inc/mcu_init.h +++ b/board/NUCLEO_STM32L053R8/BSP/Inc/mcu_init.h @@ -10,7 +10,7 @@ #include "i2c.h" #include "gpio.h" #include "rhf76_lora.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/NUCLEO_STM32L053R8/BSP/Src/rhf76_lora.c b/board/NUCLEO_STM32L053R8/BSP/Src/rhf76_lora.c index 8f7a53f4..45e85e39 100644 --- a/board/NUCLEO_STM32L053R8/BSP/Src/rhf76_lora.c +++ b/board/NUCLEO_STM32L053R8/BSP/Src/rhf76_lora.c @@ -1,5 +1,5 @@ #include "rhf76_lora.h" -#include "tos.h" +#include "tos_k.h" uint16_t rx_rd_index = 0; uint16_t rx_wr_index = 0; @@ -89,8 +89,8 @@ bool rhf76_send_cmd(char * cmd, uint32_t len,char * reply1, char * reply2, uint3 dev_uart_recv((uint8_t *)buf, 120, 20); printf("%s",buf); if ( ( reply1 != 0 ) && ( reply2 != 0 ) ) - return ( ( bool ) strstr ( buf, reply1 ) || - ( bool ) strstr ( buf, reply2 ) ); + return ( ( bool ) strstr ( buf, reply1 ) || + ( bool ) strstr ( buf, reply2 ) ); else if ( reply1 != 0 ) return ( ( bool ) strstr ( buf, reply1 ) ); @@ -155,7 +155,7 @@ void rhf76_set_class ( ENUM_CLASS_TypeDef type ) break; default: break; - } + } } void rhf76_set_chanel(void) @@ -250,7 +250,7 @@ static void __hex2str(uint8_t *in, char *out, int len) } int rhf76_send(const void *buf, uint32_t len) -{ +{ char *str_buf = NULL; str_buf = tos_mmheap_calloc(2 * len + 1, sizeof(char)); @@ -258,13 +258,13 @@ int rhf76_send(const void *buf, uint32_t len) return -1; } __hex2str((uint8_t *)buf, str_buf, len); - + char cmd[100] = {0}; - + snprintf(cmd, sizeof(cmd), "AT+CMSGHEX=\"%s\"\r\n", str_buf); cmd[sizeof(cmd) - 1] = '\0'; tos_mmheap_free(str_buf); rhf76_send_cmd((char *)cmd, strlen(cmd), (char *)"ACK Received","Done",10000); - return len; + return len; } diff --git a/board/NUCLEO_STM32L053R8/BSP/Src/stm32l0xx_it.c b/board/NUCLEO_STM32L053R8/BSP/Src/stm32l0xx_it.c index 5e2096c3..186df70a 100644 --- a/board/NUCLEO_STM32L053R8/BSP/Src/stm32l0xx_it.c +++ b/board/NUCLEO_STM32L053R8/BSP/Src/stm32l0xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l0xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -64,7 +64,7 @@ extern UART_HandleTypeDef huart2; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M0+ Processor Interruption and Exception Handlers */ +/* Cortex-M0+ Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -132,7 +132,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32L053R8/BSP/Src/stm32l0xx_it_module.c b/board/NUCLEO_STM32L053R8/BSP/Src/stm32l0xx_it_module.c index 5e2096c3..186df70a 100644 --- a/board/NUCLEO_STM32L053R8/BSP/Src/stm32l0xx_it_module.c +++ b/board/NUCLEO_STM32L053R8/BSP/Src/stm32l0xx_it_module.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l0xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -64,7 +64,7 @@ extern UART_HandleTypeDef huart2; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M0+ Processor Interruption and Exception Handlers */ +/* Cortex-M0+ Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -132,7 +132,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32L073RZ/BSP/Inc/mcu_init.h b/board/NUCLEO_STM32L073RZ/BSP/Inc/mcu_init.h index 0e9875ee..0dc51aff 100644 --- a/board/NUCLEO_STM32L073RZ/BSP/Inc/mcu_init.h +++ b/board/NUCLEO_STM32L073RZ/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32l0xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" #include "i2c.h" void board_init(void); diff --git a/board/NUCLEO_STM32L073RZ/BSP/Src/stm32l0xx_it.c b/board/NUCLEO_STM32L073RZ/BSP/Src/stm32l0xx_it.c index e23307be..90b89401 100644 --- a/board/NUCLEO_STM32L073RZ/BSP/Src/stm32l0xx_it.c +++ b/board/NUCLEO_STM32L073RZ/BSP/Src/stm32l0xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l0xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -64,7 +64,7 @@ extern UART_HandleTypeDef huart2; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M0+ Processor Interruption and Exception Handlers */ +/* Cortex-M0+ Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable Interrupt. @@ -132,7 +132,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32L073RZ/BSP/Src/stm32l0xx_it_lorawan.c b/board/NUCLEO_STM32L073RZ/BSP/Src/stm32l0xx_it_lorawan.c index 2e0146a7..f3f019db 100644 --- a/board/NUCLEO_STM32L073RZ/BSP/Src/stm32l0xx_it_lorawan.c +++ b/board/NUCLEO_STM32L073RZ/BSP/Src/stm32l0xx_it_lorawan.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l0xx_it.h" -#include "tos.h" +#include "tos_k.h" #include "tos_at.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ @@ -34,7 +34,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -65,7 +65,7 @@ extern UART_HandleTypeDef huart2; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M0+ Processor Interruption and Exception Handlers */ +/* Cortex-M0+ Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable Interrupt. @@ -133,7 +133,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32L432KC/BSP/Inc/mcu_init.h b/board/NUCLEO_STM32L432KC/BSP/Inc/mcu_init.h index 5c1cc892..ded9f4c0 100644 --- a/board/NUCLEO_STM32L432KC/BSP/Inc/mcu_init.h +++ b/board/NUCLEO_STM32L432KC/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32l4xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/NUCLEO_STM32L432KC/BSP/Src/stm32l4xx_it.c b/board/NUCLEO_STM32L432KC/BSP/Src/stm32l4xx_it.c index a08c7de5..aeae9102 100644 --- a/board/NUCLEO_STM32L432KC/BSP/Src/stm32l4xx_it.c +++ b/board/NUCLEO_STM32L432KC/BSP/Src/stm32l4xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l4xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -189,7 +189,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32L433RC/BSP/Inc/mcu_init.h b/board/NUCLEO_STM32L433RC/BSP/Inc/mcu_init.h index 5c1cc892..ded9f4c0 100644 --- a/board/NUCLEO_STM32L433RC/BSP/Inc/mcu_init.h +++ b/board/NUCLEO_STM32L433RC/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32l4xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/NUCLEO_STM32L433RC/BSP/Src/stm32l4xx_it.c b/board/NUCLEO_STM32L433RC/BSP/Src/stm32l4xx_it.c index 8786030b..aeae9102 100644 --- a/board/NUCLEO_STM32L433RC/BSP/Src/stm32l4xx_it.c +++ b/board/NUCLEO_STM32L433RC/BSP/Src/stm32l4xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l4xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -189,7 +189,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32L452RE/BSP/Src/stm32l4xx_it.c b/board/NUCLEO_STM32L452RE/BSP/Src/stm32l4xx_it.c index 5da01692..d5594b70 100644 --- a/board/NUCLEO_STM32L452RE/BSP/Src/stm32l4xx_it.c +++ b/board/NUCLEO_STM32L452RE/BSP/Src/stm32l4xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l4xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. diff --git a/board/NUCLEO_STM32L476RG/BSP/Inc/mcu_init.h b/board/NUCLEO_STM32L476RG/BSP/Inc/mcu_init.h index 5c1cc892..ded9f4c0 100644 --- a/board/NUCLEO_STM32L476RG/BSP/Inc/mcu_init.h +++ b/board/NUCLEO_STM32L476RG/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32l4xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/NUCLEO_STM32L476RG/BSP/Src/stm32l4xx_it.c b/board/NUCLEO_STM32L476RG/BSP/Src/stm32l4xx_it.c index 9303c2b2..aeae9102 100644 --- a/board/NUCLEO_STM32L476RG/BSP/Src/stm32l4xx_it.c +++ b/board/NUCLEO_STM32L476RG/BSP/Src/stm32l4xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l4xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -189,7 +189,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NUCLEO_STM32L496ZG/BSP/Inc/mcu_init.h b/board/NUCLEO_STM32L496ZG/BSP/Inc/mcu_init.h index 5c1cc892..ded9f4c0 100644 --- a/board/NUCLEO_STM32L496ZG/BSP/Inc/mcu_init.h +++ b/board/NUCLEO_STM32L496ZG/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32l4xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/NUCLEO_STM32L496ZG/BSP/Src/stm32l4xx_it.c b/board/NUCLEO_STM32L496ZG/BSP/Src/stm32l4xx_it.c index a08c7de5..aeae9102 100644 --- a/board/NUCLEO_STM32L496ZG/BSP/Src/stm32l4xx_it.c +++ b/board/NUCLEO_STM32L496ZG/BSP/Src/stm32l4xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l4xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -189,7 +189,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NXP-FRDM-KL27Z/BSP/Src/clock_config.c b/board/NXP-FRDM-KL27Z/BSP/Src/clock_config.c index 097375ea..037578d2 100644 --- a/board/NXP-FRDM-KL27Z/BSP/Src/clock_config.c +++ b/board/NXP-FRDM-KL27Z/BSP/Src/clock_config.c @@ -57,7 +57,7 @@ board: FRDM-KL27Z #include "fsl_smc.h" #include "clock_config.h" -#include "tos.h" +#include "tos_k.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -234,7 +234,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NXP_FRDM_KL25Z/BSP/Src/clock_config.c b/board/NXP_FRDM_KL25Z/BSP/Src/clock_config.c index ecbb2050..df0d6e32 100644 --- a/board/NXP_FRDM_KL25Z/BSP/Src/clock_config.c +++ b/board/NXP_FRDM_KL25Z/BSP/Src/clock_config.c @@ -68,7 +68,7 @@ board: FRDM-KL25Z #include "fsl_smc.h" #include "clock_config.h" -#include "tos.h" +#include "tos_k.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -195,7 +195,7 @@ void BOARD_BootClockRUN(void) &mcgConfig_BOARD_BootClockRUN.pll0Config); /* Configure the Internal Reference clock (MCGIRCLK). */ CLOCK_SetInternalRefClkConfig(mcgConfig_BOARD_BootClockRUN.irclkEnableMode, - mcgConfig_BOARD_BootClockRUN.ircs, + mcgConfig_BOARD_BootClockRUN.ircs, mcgConfig_BOARD_BootClockRUN.fcrdiv); /* Set the clock configuration in SIM module. */ CLOCK_SetSimConfig(&simConfig_BOARD_BootClockRUN); @@ -302,7 +302,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/NXP_LPC824Lite/BSP/Src/clock_config.c b/board/NXP_LPC824Lite/BSP/Src/clock_config.c index 3376da4f..32c79a28 100644 --- a/board/NXP_LPC824Lite/BSP/Src/clock_config.c +++ b/board/NXP_LPC824Lite/BSP/Src/clock_config.c @@ -54,7 +54,7 @@ processor_version: 0.0.1 #include "fsl_power.h" #include "fsl_clock.h" #include "clock_config.h" -#include "tos.h" +#include "tos_k.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -167,7 +167,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/Nordic_NRF51822/BSP/Inc/main.h b/board/Nordic_NRF51822/BSP/Inc/main.h index 72e1addc..b5216d5a 100644 --- a/board/Nordic_NRF51822/BSP/Inc/main.h +++ b/board/Nordic_NRF51822/BSP/Inc/main.h @@ -13,7 +13,7 @@ #define MAIN_H -#include "tos.h" +#include "tos_k.h" #include "nrf_gpio.h" #define LED_START 18 diff --git a/board/Nordic_NRF52832/BSP/Inc/main.h b/board/Nordic_NRF52832/BSP/Inc/main.h index dc4b41c9..f0782127 100644 --- a/board/Nordic_NRF52832/BSP/Inc/main.h +++ b/board/Nordic_NRF52832/BSP/Inc/main.h @@ -13,7 +13,7 @@ #define MAIN_H -#include "tos.h" +#include "tos_k.h" #include "nrf_gpio.h" #define LED_START 18 diff --git a/board/Nordic_NRF52832/BSP/Src/nrfx_glue.c b/board/Nordic_NRF52832/BSP/Src/nrfx_glue.c index 1dbca563..e2eacaf6 100644 --- a/board/Nordic_NRF52832/BSP/Src/nrfx_glue.c +++ b/board/Nordic_NRF52832/BSP/Src/nrfx_glue.c @@ -7,7 +7,7 @@ #include "nrf.h" #include "nrfx_glue.h" -#include +#include #define NUM_IRQS_PER_REG 32 #define REG_FROM_IRQ(irq) (irq / NUM_IRQS_PER_REG) diff --git a/board/Nordic_NRF52840/BSP/Inc/main.h b/board/Nordic_NRF52840/BSP/Inc/main.h index ec0343ec..650e42b7 100644 --- a/board/Nordic_NRF52840/BSP/Inc/main.h +++ b/board/Nordic_NRF52840/BSP/Inc/main.h @@ -12,7 +12,7 @@ #ifndef MAIN_H #define MAIN_H -#include "tos.h" +#include "tos_k.h" #include "nrf_gpio.h" #define LED_START 18 diff --git a/board/Nordic_NRF52840/BSP/Src/nrfx_glue.c b/board/Nordic_NRF52840/BSP/Src/nrfx_glue.c index 1dbca563..e2eacaf6 100644 --- a/board/Nordic_NRF52840/BSP/Src/nrfx_glue.c +++ b/board/Nordic_NRF52840/BSP/Src/nrfx_glue.c @@ -7,7 +7,7 @@ #include "nrf.h" #include "nrfx_glue.h" -#include +#include #define NUM_IRQS_PER_REG 32 #define REG_FROM_IRQ(irq) (irq / NUM_IRQS_PER_REG) diff --git a/board/Nuvoton_M251/BSP/Src/main.c b/board/Nuvoton_M251/BSP/Src/main.c index a3ff2469..8db7e611 100644 --- a/board/Nuvoton_M251/BSP/Src/main.c +++ b/board/Nuvoton_M251/BSP/Src/main.c @@ -1,13 +1,13 @@ #include "stdio.h" #include "NuMicro.h" -#include "tos.h" +#include "tos_k.h" #define task1_size 240 // size of task1 stack -#define task2_size 240 +#define task2_size 240 k_task_t task1; //structure of task1 -k_task_t task2; +k_task_t task2; k_stack_t task1_stack[task1_size]; //stack of task1 -k_stack_t task2_stack[task2_size]; +k_stack_t task2_stack[task2_size]; void SYS_Init(void) { @@ -16,28 +16,28 @@ void SYS_Init(void) /*---------------------------------------------------------------------------------------------------------*/ /* Unlock protected registers */ SYS_UnlockReg(); - + /* Set XT1_OUT(PF.2) and XT1_IN(PF.3) to input mode to prevent leakage */ PF->MODE &= ~(GPIO_MODE_MODE2_Msk | GPIO_MODE_MODE3_Msk); /* Disable digital input path of analog pin XT1_OUT to prevent leakage */ GPIO_DISABLE_DIGITAL_PATH(PF, BIT2 | BIT3); - + /* Enable, HXT clock */ - CLK_EnableXtalRC(CLK_PWRCTL_HXTEN_Msk); - + CLK_EnableXtalRC(CLK_PWRCTL_HXTEN_Msk); + /* Switch HCLK clock source to external */ CLK_SetHCLK(CLK_CLKSEL0_HCLKSEL_HXT, CLK_CLKDIV0_HCLK(1)); //here switch zhe MCU clock to external - + /*Set the core clock freq*/ CLK_SetCoreClock(FREQ_32MHZ); //set the core clock freq,should not higher than your HCLK clock freq - + /* Enable UART module clock */ CLK_EnableModuleClock(UART0_MODULE); /* Select UART module clock source as HIRC and UART module clock divider as 1 */ CLK_SetModuleClock(UART0_MODULE, CLK_CLKSEL1_UART0SEL_HIRC, CLK_CLKDIV0_UART0(1)); - + /*---------------------------------------------------------------------------------------------------------*/ /* Init I/O Multi-function */ /*---------------------------------------------------------------------------------------------------------*/ @@ -62,9 +62,9 @@ void task1_fun(void *Parameter) while(1) { - printf("Task1 :Thansplant CORTEX-M23 Succeed\r\n"); - PB14 =~ PB14; - tos_task_delay(1000); + printf("Task1 :Thansplant CORTEX-M23 Succeed\r\n"); + PB14 =~ PB14; + tos_task_delay(1000); } } @@ -74,9 +74,9 @@ void task2_task(void *Parameter) k_err_t err; while(1) - { - printf("Task2: hello world, hello Nuvoton \r\n"); - tos_task_delay(100); + { + printf("Task2: hello world, hello Nuvoton \r\n"); + tos_task_delay(100); } } @@ -88,17 +88,17 @@ int main() /* Init System, peripheral clock and multi-function I/O */ SYS_Init(); - + tos_knl_init(); //tos init ,include SystickInit,should init after protected registers unlock - + /* Lock protected registers */ SYS_LockReg(); - + /* Init UART0 for printf */ UART0_Init(); printf("system clock to %d Hz, PLL clock to %d Hz...................... ", SystemCoreClock, CLK_SetCoreClock(FREQ_32MHZ)); - + GPIO_SetMode(PB, BIT14, GPIO_MODE_OUTPUT); err = tos_task_create( @@ -111,21 +111,21 @@ int main() task1_size, 100 ); - + err = tos_task_create( - &task2, - "display", - task2_task, - NULL, - 2, - task2_stack, - task2_size, - 100); - + &task2, + "display", + task2_task, + NULL, + 2, + task2_stack, + task2_size, + 100); + if(err != K_ERR_NONE) printf("TenentOS creat task fail! code is %d\r\n",err); - + tos_knl_start(); //Start TOS TINY - + } diff --git a/board/Nuvoton_M251/BSP/Src/system_M251.c b/board/Nuvoton_M251/BSP/Src/system_M251.c index 95efa0d5..86080339 100644 --- a/board/Nuvoton_M251/BSP/Src/system_M251.c +++ b/board/Nuvoton_M251/BSP/Src/system_M251.c @@ -10,7 +10,7 @@ #include #include #include "M251.h" -#include "tos.h" //include tos.h +#include "tos_k.h" #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) #include "partition_M251.h" #endif diff --git a/board/QEMU_Spike/Src/gd32vf103_it.c b/board/QEMU_Spike/Src/gd32vf103_it.c index cf55f885..ab53e753 100644 --- a/board/QEMU_Spike/Src/gd32vf103_it.c +++ b/board/QEMU_Spike/Src/gd32vf103_it.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" void SysTick_IRQHandler() { port_systick_config((uint32_t)k_cpu_cycle_per_tick); if (tos_knl_is_running()) { diff --git a/board/QEMU_Spike/Src/main.c b/board/QEMU_Spike/Src/main.c index b9c899be..603573df 100644 --- a/board/QEMU_Spike/Src/main.c +++ b/board/QEMU_Spike/Src/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #define TASK_SIZE 512 k_task_t k_task_task1; diff --git a/board/RHF76_STM32L072CBxx_Lora/Src/board.c b/board/RHF76_STM32L072CBxx_Lora/Src/board.c index d8032329..462c2526 100644 --- a/board/RHF76_STM32L072CBxx_Lora/Src/board.c +++ b/board/RHF76_STM32L072CBxx_Lora/Src/board.c @@ -33,7 +33,7 @@ #include "rtc-board.h" #include "sx1276-board.h" #include "board.h" -#include "tos.h" +#include "tos_k.h" /*! * Unique Devices IDs register set ( STM32L0xxx ) */ @@ -335,7 +335,7 @@ void SysTick_Handler( void ) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } //HAL_SYSTICK_IRQHandler( ); @@ -410,7 +410,7 @@ void BoardLowPowerHandler( void ) { __disable_irq( ); /*! - * If an interrupt has occurred after __disable_irq( ), it is kept pending + * If an interrupt has occurred after __disable_irq( ), it is kept pending * and cortex will not enter low power anyway */ diff --git a/board/RHF76_STM32L072CBxx_Lora/apps/classA/main.c b/board/RHF76_STM32L072CBxx_Lora/apps/classA/main.c index bffd1311..e1cb8355 100644 --- a/board/RHF76_STM32L072CBxx_Lora/apps/classA/main.c +++ b/board/RHF76_STM32L072CBxx_Lora/apps/classA/main.c @@ -1,7 +1,7 @@ #include "LoRaApi.h" #include #include -#include "tos.h" +#include "tos_k.h" #include "atcmd-board.h" /*LORA入网状态*/ uint8_t g_join_state = 0; @@ -11,11 +11,11 @@ uint32_t g_rx_num = 0; //任务优先级 #define TASK1_PRIO 3 -//任务堆栈大小 +//任务堆栈大小 #define TASK1_STK_SIZE (1024 * 4) //任务控制块 k_task_t Task1TCB; -//任务堆栈 +//任务堆栈 k_stack_t TASK1_STK[TASK1_STK_SIZE]; //任务函数 void task1(void *arg); @@ -58,7 +58,7 @@ void task1(void *arg) Lora_Send(0, 2, tmpbuf, sizeof(tmpbuf)); g_rx_num++; } - } + } at_cmd_handle(); } } diff --git a/board/STM32F103_SIM800A/Hardware/fatfs_drv.c b/board/STM32F103_SIM800A/Hardware/fatfs_drv.c index bf73c910..50fc9aa7 100644 --- a/board/STM32F103_SIM800A/Hardware/fatfs_drv.c +++ b/board/STM32F103_SIM800A/Hardware/fatfs_drv.c @@ -2,7 +2,7 @@ //#include "fatfs.h" #include "fatfs_drv.h" -#include "tos.h" +#include "tos_k.h" #include /* Defines ------------------------------------------------------------------*/ diff --git a/board/STM32F103_SIM800A/Src/stm32f1xx_it.c b/board/STM32F103_SIM800A/Src/stm32f1xx_it.c index a79ac81c..74a3bc1f 100644 --- a/board/STM32F103_SIM800A/Src/stm32f1xx_it.c +++ b/board/STM32F103_SIM800A/Src/stm32f1xx_it.c @@ -31,7 +31,7 @@ ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #include "tos_at.h" #include "usart.h" @@ -48,7 +48,7 @@ extern UART_HandleTypeDef huart2; extern UART_HandleTypeDef huart3; /******************************************************************************/ -/* Cortex-M3 Processor Interruption and Exception Handlers */ +/* Cortex-M3 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** @@ -187,7 +187,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } //HAL_SYSTICK_IRQHandler(); diff --git a/board/STM32F407VGT6_discovery/BSP/Inc/mcu_init.h b/board/STM32F407VGT6_discovery/BSP/Inc/mcu_init.h index f4212ae9..8a4112e1 100644 --- a/board/STM32F407VGT6_discovery/BSP/Inc/mcu_init.h +++ b/board/STM32F407VGT6_discovery/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32f4xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/STM32F407VGT6_discovery/BSP/Src/stm32f4xx_it.c b/board/STM32F407VGT6_discovery/BSP/Src/stm32f4xx_it.c index 423799f2..2bd24861 100644 --- a/board/STM32F407VGT6_discovery/BSP/Src/stm32f4xx_it.c +++ b/board/STM32F407VGT6_discovery/BSP/Src/stm32f4xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f4xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -64,7 +64,7 @@ extern UART_HandleTypeDef huart2; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -187,11 +187,11 @@ void SysTick_Handler(void) /* USER CODE END SysTick_IRQn 0 */ HAL_IncTick(); - if(tos_knl_is_running()) + if(tos_knl_is_running()) { - tos_knl_irq_enter(); - tos_tick_handler(); - tos_knl_irq_leave(); + tos_knl_irq_enter(); + tos_tick_handler(); + tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/STM32F746NGH6_discovery/BSP/Inc/mcu_init.h b/board/STM32F746NGH6_discovery/BSP/Inc/mcu_init.h index 3325ef35..33fb175b 100644 --- a/board/STM32F746NGH6_discovery/BSP/Inc/mcu_init.h +++ b/board/STM32F746NGH6_discovery/BSP/Inc/mcu_init.h @@ -10,7 +10,7 @@ #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/STM32F746NGH6_discovery/BSP/Src/stm32f7xx_it.c b/board/STM32F746NGH6_discovery/BSP/Src/stm32f7xx_it.c index f62436bf..597638f6 100644 --- a/board/STM32F746NGH6_discovery/BSP/Src/stm32f7xx_it.c +++ b/board/STM32F746NGH6_discovery/BSP/Src/stm32f7xx_it.c @@ -21,11 +21,11 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f7xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ - + /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN TD */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ extern UART_HandleTypeDef huart1; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M7 Processor Interruption and Exception Handlers */ +/* Cortex-M7 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -189,7 +189,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/STM32F746NGH6_discovery/BSP/Src/stm32f7xx_it_lvgl.c b/board/STM32F746NGH6_discovery/BSP/Src/stm32f7xx_it_lvgl.c index 37f73d63..2c5df143 100644 --- a/board/STM32F746NGH6_discovery/BSP/Src/stm32f7xx_it_lvgl.c +++ b/board/STM32F746NGH6_discovery/BSP/Src/stm32f7xx_it_lvgl.c @@ -21,12 +21,12 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f7xx_it.h" -#include "tos.h" +#include "tos_k.h" #include "lvgl/src/lv_hal/lv_hal_tick.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ - + /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN TD */ @@ -34,7 +34,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -64,7 +64,7 @@ extern UART_HandleTypeDef huart1; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M7 Processor Interruption and Exception Handlers */ +/* Cortex-M7 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -191,7 +191,7 @@ void SysTick_Handler(void) if(tos_knl_is_running()) { tos_knl_irq_enter(); - tos_tick_handler(); + tos_tick_handler(); tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/board/Sipeed_LonganNano/BSP/Src/gd32vf103_it.c b/board/Sipeed_LonganNano/BSP/Src/gd32vf103_it.c index aa33583b..953c2f64 100644 --- a/board/Sipeed_LonganNano/BSP/Src/gd32vf103_it.c +++ b/board/Sipeed_LonganNano/BSP/Src/gd32vf103_it.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" // systick handler void eclic_mtip_handler() { diff --git a/board/Sipeed_LonganNano/eclipse/hello_world/main.c b/board/Sipeed_LonganNano/eclipse/hello_world/main.c index bfcad07b..44b9824b 100644 --- a/board/Sipeed_LonganNano/eclipse/hello_world/main.c +++ b/board/Sipeed_LonganNano/eclipse/hello_world/main.c @@ -1,5 +1,5 @@ #include "mcu_init.h" -#include "tos.h" +#include "tos_k.h" #include "lcd.h" #define TASK_SIZE 1024 diff --git a/board/TI_MSP430FR6972_EVM/BSP/Src/main.c b/board/TI_MSP430FR6972_EVM/BSP/Src/main.c index 428f9b56..be106529 100644 --- a/board/TI_MSP430FR6972_EVM/BSP/Src/main.c +++ b/board/TI_MSP430FR6972_EVM/BSP/Src/main.c @@ -21,7 +21,7 @@ #include #include #include -#include "tos.h" +#include "tos_k.h" #define TASK1_STK_SIZE 320 // more than 300 for stb printf #define TASK2_STK_SIZE 320 // more than 300 for stb printf @@ -41,13 +41,13 @@ void task2_entry(void *arg); /* EUSCI-UART-UCA1 115200 @ 8M */ -EUSCI_A_UART_initParam uart_config = +EUSCI_A_UART_initParam uart_config = { EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source - - 4, // BRDIV - 5, // UCxBRF - 85, // UCxBRS + + 4, // BRDIV + 5, // UCxBRF + 85, // UCxBRS EUSCI_A_UART_NO_PARITY, // No Parity EUSCI_A_UART_LSB_FIRST, // MSB First @@ -64,11 +64,11 @@ EUSCI_A_UART_initParam uart_config = */ void systick_handler(void) { - if(tos_knl_is_running()) + if(tos_knl_is_running()) { - tos_knl_irq_enter(); - tos_tick_handler(); - tos_knl_irq_leave(); + tos_knl_irq_enter(); + tos_tick_handler(); + tos_knl_irq_leave(); } } @@ -105,7 +105,7 @@ void board_init(void) /* Disable the GPIO power-on default high-impedance mode. */ PMM_unlockLPM5(); - + /* Set P1.0(LED1) to output direction */ GPIO_setAsOutputPin(GPIO_PORT_P1,GPIO_PIN0); @@ -117,7 +117,7 @@ void board_init(void) GPIO_setAsOutputPin( GPIO_PORT_P3, GPIO_PIN4 ); GPIO_setAsPeripheralModuleFunctionInputPin( GPIO_PORT_P3, GPIO_PIN5, GPIO_PRIMARY_MODULE_FUNCTION ); GPIO_setAsPeripheralModuleFunctionOutputPin( GPIO_PORT_P3, GPIO_PIN4, GPIO_PRIMARY_MODULE_FUNCTION ); - + EUSCI_A_UART_init(EUSCI_A1_BASE, &uart_config); EUSCI_A_UART_enable(EUSCI_A1_BASE); //EUSCI_A_UART_enableInterrupt(EUSCI_A1_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT); @@ -130,7 +130,7 @@ void board_init(void) * @return ch */ int putchar(int ch) -{ +{ EUSCI_A_UART_transmitData(EUSCI_A1_BASE, ch); return (ch); @@ -145,10 +145,10 @@ int putchar(int ch) void task1_entry(void *arg) { int count = 1; - while (1) + while (1) { printf("###This is task1, %d\r\n", count++); - + GPIO_toggleOutputOnPin(GPIO_PORT_P1,GPIO_PIN0); tos_task_delay(tos_millisec2tick(2000)); @@ -164,12 +164,12 @@ void task1_entry(void *arg) void task2_entry(void *arg) { int count = 1; - while (1) - { + while (1) + { printf("***This is task2, %d\r\n", count++); GPIO_toggleOutputOnPin(GPIO_PORT_P9,GPIO_PIN7); - + tos_task_delay(tos_millisec2tick(1000)); } } @@ -177,11 +177,11 @@ void task2_entry(void *arg) int main(void) { k_err_t err; - + board_init(); - + printf("Welcome to TencentOS tiny\r\n"); - + tos_knl_init(); err = tos_task_create(&task1, "task1", task1_entry, @@ -189,7 +189,7 @@ int main(void) task1_stack, sizeof(task1_stack),0); err = tos_task_create(&task2, "task2", task2_entry, K_NULL, TASK2_PRIO, - task2_stack, sizeof(task2_stack),0); + task2_stack, sizeof(task2_stack),0); if( err == K_ERR_NONE ) { err = tos_knl_start(); @@ -197,7 +197,7 @@ int main(void) else { printf("TencentOS tiny fail to creat tasks \r\n"); - + while(1); } } diff --git a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Inc/mcu_init.h b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Inc/mcu_init.h index 876cee4c..179ab9e5 100644 --- a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Inc/mcu_init.h +++ b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Inc/mcu_init.h @@ -12,7 +12,7 @@ #include "i2c.h" #include "bh1750.h" #include "DHT11_BUS.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/stm32l4xx_it.c b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/stm32l4xx_it.c index 1a9eb139..77b25555 100644 --- a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/stm32l4xx_it.c +++ b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/stm32l4xx_it.c @@ -34,7 +34,7 @@ #include "stm32l4xx_hal.h" #include "stm32l4xx.h" #include "stm32l4xx_it.h" -#include "tos.h" +#include "tos_k.h" /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ @@ -45,7 +45,7 @@ extern UART_HandleTypeDef huart2; extern UART_HandleTypeDef huart3; /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** diff --git a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/stm32l4xx_it_at.c b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/stm32l4xx_it_at.c index fd46342e..27ced435 100644 --- a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/stm32l4xx_it_at.c +++ b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/stm32l4xx_it_at.c @@ -34,7 +34,7 @@ #include "stm32l4xx_hal.h" #include "stm32l4xx.h" #include "stm32l4xx_it.h" -#include "tos.h" +#include "tos_k.h" #include "tos_at.h" /* USER CODE BEGIN 0 */ @@ -46,7 +46,7 @@ extern UART_HandleTypeDef huart2; extern UART_HandleTypeDef huart3; /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** diff --git a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/stm32l4xx_it_mqtt.c b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/stm32l4xx_it_mqtt.c index 8023a3b3..b5a5fe72 100644 --- a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/stm32l4xx_it_mqtt.c +++ b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/stm32l4xx_it_mqtt.c @@ -31,7 +31,7 @@ ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #include "tos_at.h" #include "stm32l4xx_hal.h" @@ -47,7 +47,7 @@ extern UART_HandleTypeDef huart2; extern UART_HandleTypeDef huart3; /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** diff --git a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/tickless/bsp_pm_device.c b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/tickless/bsp_pm_device.c index dbbbc4d0..bc95c813 100644 --- a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/tickless/bsp_pm_device.c +++ b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/tickless/bsp_pm_device.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #if TOS_CFG_PWR_MGR_EN > 0u diff --git a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/tickless/bsp_pwr_mgr.c b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/tickless/bsp_pwr_mgr.c index 46c2ed69..a8df35a8 100644 --- a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/tickless/bsp_pwr_mgr.c +++ b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/tickless/bsp_pwr_mgr.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tickless/bsp_pm_device.h" #include "tickless/bsp_tickless_alarm.h" diff --git a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/tickless/bsp_tickless_alarm.c b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/tickless/bsp_tickless_alarm.c index d9ef13c2..4f2afbd9 100644 --- a/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/tickless/bsp_tickless_alarm.c +++ b/board/TOS_tiny_EVK_STM32L431CBT6/BSP/Src/tickless/bsp_tickless_alarm.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "stm32l4xx_hal.h" #include "stm32l4xx_hal_tim.h" @@ -75,7 +75,7 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *tim_handler) /* TIM6 interrupt Deinit */ HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn); } -} +} static int tickless_tim6_wkup_alarm_init(void) { @@ -153,7 +153,7 @@ static HAL_StatusTypeDef tickless_rtc_time_set(uint8_t hour, uint8_t minu, uint8 rtc_time.TimeFormat = format; rtc_time.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; rtc_time.StoreOperation = RTC_STOREOPERATION_RESET; - return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN); + return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN); } static HAL_StatusTypeDef tickless_rtc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week) @@ -250,7 +250,7 @@ void HAL_RTC_MspInit(RTC_HandleTypeDef *rtc_handler) void RTC_WKUP_IRQHandler(void) { - HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler); + HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler); } void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *rtc_handler) @@ -327,11 +327,11 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond) // __HAL_PWR_GET_FLAG(PWR_FLAG_WU) - __HAL_RCC_AHB1_FORCE_RESET(); //复位所有IO口 + __HAL_RCC_AHB1_FORCE_RESET(); //复位所有IO口 __HAL_RCC_PWR_CLK_ENABLE(); //使能PWR时钟 // __HAL_RCC_BACKUPRESET_FORCE(); //复位备份区域 - HAL_PWR_EnableBkUpAccess(); //后备区域访问使能 + HAL_PWR_EnableBkUpAccess(); //后备区域访问使能 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB); __HAL_RTC_WRITEPROTECTION_DISABLE(&rtc_handler);//关闭RTC写保护 @@ -345,7 +345,7 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond) //清除RTC相关中断标志位 __HAL_RTC_ALARM_CLEAR_FLAG(&rtc_handler,RTC_FLAG_ALRAF|RTC_FLAG_ALRBF); - __HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF); + __HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF); __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&rtc_handler,RTC_FLAG_WUTF); // __HAL_RCC_BACKUPRESET_RELEASE(); //备份区域复位结束 diff --git a/board/TencentOS_tiny_EVB_LX/BSP/Src/gd32vf103_it.c b/board/TencentOS_tiny_EVB_LX/BSP/Src/gd32vf103_it.c index aa33583b..953c2f64 100644 --- a/board/TencentOS_tiny_EVB_LX/BSP/Src/gd32vf103_it.c +++ b/board/TencentOS_tiny_EVB_LX/BSP/Src/gd32vf103_it.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" // systick handler void eclic_mtip_handler() { diff --git a/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/main.c b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/main.c index 3541a26f..80bf8bc6 100644 --- a/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/main.c +++ b/board/TencentOS_tiny_EVB_LX/eclipse/hello_world/main.c @@ -1,5 +1,5 @@ #include "mcu_init.h" -#include "tos.h" +#include "tos_k.h" #define TASK_SIZE 1024 k_task_t k_task_task1; diff --git a/board/TencentOS_tiny_EVB_MX/BSP/Inc/mcu_init.h b/board/TencentOS_tiny_EVB_MX/BSP/Inc/mcu_init.h index d830e091..2d6706b3 100644 --- a/board/TencentOS_tiny_EVB_MX/BSP/Inc/mcu_init.h +++ b/board/TencentOS_tiny_EVB_MX/BSP/Inc/mcu_init.h @@ -14,7 +14,7 @@ #include "oled.h" #include "DHT11_BUS.h" #include "bh1750.h" -#include "tos.h" +#include "tos_k.h" void m26_power_on(void); void board_init(void); diff --git a/board/TencentOS_tiny_EVB_MX/BSP/Src/stm32l4xx_it.c b/board/TencentOS_tiny_EVB_MX/BSP/Src/stm32l4xx_it.c index 6556bc9a..8c8c5f5a 100644 --- a/board/TencentOS_tiny_EVB_MX/BSP/Src/stm32l4xx_it.c +++ b/board/TencentOS_tiny_EVB_MX/BSP/Src/stm32l4xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l4xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -65,7 +65,7 @@ extern UART_HandleTypeDef huart3; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. diff --git a/board/TencentOS_tiny_EVB_MX/BSP/Src/stm32l4xx_it_module.c b/board/TencentOS_tiny_EVB_MX/BSP/Src/stm32l4xx_it_module.c index 517f19ae..0d2069c2 100644 --- a/board/TencentOS_tiny_EVB_MX/BSP/Src/stm32l4xx_it_module.c +++ b/board/TencentOS_tiny_EVB_MX/BSP/Src/stm32l4xx_it_module.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l4xx_it.h" -#include "tos.h" +#include "tos_k.h" #include "tos_at.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ @@ -34,7 +34,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -66,7 +66,7 @@ extern UART_HandleTypeDef huart3; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. diff --git a/board/TencentOS_tiny_EVB_MX/BSP/Src/tickless/bsp_pm_device.c b/board/TencentOS_tiny_EVB_MX/BSP/Src/tickless/bsp_pm_device.c index dbbbc4d0..bc95c813 100644 --- a/board/TencentOS_tiny_EVB_MX/BSP/Src/tickless/bsp_pm_device.c +++ b/board/TencentOS_tiny_EVB_MX/BSP/Src/tickless/bsp_pm_device.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #if TOS_CFG_PWR_MGR_EN > 0u diff --git a/board/TencentOS_tiny_EVB_MX/BSP/Src/tickless/bsp_pwr_mgr.c b/board/TencentOS_tiny_EVB_MX/BSP/Src/tickless/bsp_pwr_mgr.c index 46c2ed69..a8df35a8 100644 --- a/board/TencentOS_tiny_EVB_MX/BSP/Src/tickless/bsp_pwr_mgr.c +++ b/board/TencentOS_tiny_EVB_MX/BSP/Src/tickless/bsp_pwr_mgr.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tickless/bsp_pm_device.h" #include "tickless/bsp_tickless_alarm.h" diff --git a/board/TencentOS_tiny_EVB_MX/BSP/Src/tickless/bsp_tickless_alarm.c b/board/TencentOS_tiny_EVB_MX/BSP/Src/tickless/bsp_tickless_alarm.c index 43b28a37..99c31edb 100644 --- a/board/TencentOS_tiny_EVB_MX/BSP/Src/tickless/bsp_tickless_alarm.c +++ b/board/TencentOS_tiny_EVB_MX/BSP/Src/tickless/bsp_tickless_alarm.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "stm32l4xx_hal.h" #include "stm32l4xx_hal_tim.h" @@ -96,7 +96,7 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *tim_handler) /* TIM6 interrupt Deinit */ HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn); } -} +} static int tickless_tim6_wkup_alarm_init(void) { @@ -177,7 +177,7 @@ static HAL_StatusTypeDef tickless_rtc_time_set(uint8_t hour, uint8_t minu, uint8 rtc_time.TimeFormat = format; rtc_time.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; rtc_time.StoreOperation = RTC_STOREOPERATION_RESET; - return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN); + return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN); } static HAL_StatusTypeDef tickless_rtc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week) @@ -274,7 +274,7 @@ void HAL_RTC_MspInit(RTC_HandleTypeDef *rtc_handler) void RTC_WKUP_IRQHandler(void) { - HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler); + HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler); } void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *rtc_handler) @@ -355,11 +355,11 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond) // __HAL_PWR_GET_FLAG(PWR_FLAG_WU) - __HAL_RCC_AHB1_FORCE_RESET(); //复位所有IO口 + __HAL_RCC_AHB1_FORCE_RESET(); //复位所有IO口 __HAL_RCC_PWR_CLK_ENABLE(); //使能PWR时钟 // __HAL_RCC_BACKUPRESET_FORCE(); //复位备份区域 - HAL_PWR_EnableBkUpAccess(); //后备区域访问使能 + HAL_PWR_EnableBkUpAccess(); //后备区域访问使能 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB); __HAL_RTC_WRITEPROTECTION_DISABLE(&rtc_handler);//关闭RTC写保护 @@ -373,7 +373,7 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond) //清除RTC相关中断标志位 __HAL_RTC_ALARM_CLEAR_FLAG(&rtc_handler,RTC_FLAG_ALRAF|RTC_FLAG_ALRBF); - __HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF); + __HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF); __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&rtc_handler,RTC_FLAG_WUTF); // __HAL_RCC_BACKUPRESET_RELEASE(); //备份区域复位结束 diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Inc/mcu_init.h b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Inc/mcu_init.h index d830e091..2d6706b3 100644 --- a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Inc/mcu_init.h +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Inc/mcu_init.h @@ -14,7 +14,7 @@ #include "oled.h" #include "DHT11_BUS.h" #include "bh1750.h" -#include "tos.h" +#include "tos_k.h" void m26_power_on(void); void board_init(void); diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/stm32l4xx_it.c b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/stm32l4xx_it.c index 6556bc9a..8c8c5f5a 100644 --- a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/stm32l4xx_it.c +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/stm32l4xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l4xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -65,7 +65,7 @@ extern UART_HandleTypeDef huart3; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/stm32l4xx_it_module.c b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/stm32l4xx_it_module.c index 517f19ae..0d2069c2 100644 --- a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/stm32l4xx_it_module.c +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/stm32l4xx_it_module.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32l4xx_it.h" -#include "tos.h" +#include "tos_k.h" #include "tos_at.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ @@ -34,7 +34,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -66,7 +66,7 @@ extern UART_HandleTypeDef huart3; /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/tickless/bsp_pm_device.c b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/tickless/bsp_pm_device.c index dbbbc4d0..bc95c813 100644 --- a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/tickless/bsp_pm_device.c +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/tickless/bsp_pm_device.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #if TOS_CFG_PWR_MGR_EN > 0u diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/tickless/bsp_pwr_mgr.c b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/tickless/bsp_pwr_mgr.c index 46c2ed69..a8df35a8 100644 --- a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/tickless/bsp_pwr_mgr.c +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/tickless/bsp_pwr_mgr.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tickless/bsp_pm_device.h" #include "tickless/bsp_tickless_alarm.h" diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/tickless/bsp_tickless_alarm.c b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/tickless/bsp_tickless_alarm.c index 43b28a37..99c31edb 100644 --- a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/tickless/bsp_tickless_alarm.c +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Src/tickless/bsp_tickless_alarm.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "stm32l4xx_hal.h" #include "stm32l4xx_hal_tim.h" @@ -96,7 +96,7 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *tim_handler) /* TIM6 interrupt Deinit */ HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn); } -} +} static int tickless_tim6_wkup_alarm_init(void) { @@ -177,7 +177,7 @@ static HAL_StatusTypeDef tickless_rtc_time_set(uint8_t hour, uint8_t minu, uint8 rtc_time.TimeFormat = format; rtc_time.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; rtc_time.StoreOperation = RTC_STOREOPERATION_RESET; - return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN); + return HAL_RTC_SetTime(&rtc_handler, &rtc_time, RTC_FORMAT_BIN); } static HAL_StatusTypeDef tickless_rtc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week) @@ -274,7 +274,7 @@ void HAL_RTC_MspInit(RTC_HandleTypeDef *rtc_handler) void RTC_WKUP_IRQHandler(void) { - HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler); + HAL_RTCEx_WakeUpTimerIRQHandler(&rtc_handler); } void HAL_RTCEx_WakeUpTimerEventCallback(RTC_HandleTypeDef *rtc_handler) @@ -355,11 +355,11 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond) // __HAL_PWR_GET_FLAG(PWR_FLAG_WU) - __HAL_RCC_AHB1_FORCE_RESET(); //复位所有IO口 + __HAL_RCC_AHB1_FORCE_RESET(); //复位所有IO口 __HAL_RCC_PWR_CLK_ENABLE(); //使能PWR时钟 // __HAL_RCC_BACKUPRESET_FORCE(); //复位备份区域 - HAL_PWR_EnableBkUpAccess(); //后备区域访问使能 + HAL_PWR_EnableBkUpAccess(); //后备区域访问使能 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB); __HAL_RTC_WRITEPROTECTION_DISABLE(&rtc_handler);//关闭RTC写保护 @@ -373,7 +373,7 @@ static int tickless_rtc_alarmirq_wkup_alarm_setup(k_time_t millisecond) //清除RTC相关中断标志位 __HAL_RTC_ALARM_CLEAR_FLAG(&rtc_handler,RTC_FLAG_ALRAF|RTC_FLAG_ALRBF); - __HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF); + __HAL_RTC_TIMESTAMP_CLEAR_FLAG(&rtc_handler,RTC_FLAG_TSF); __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&rtc_handler,RTC_FLAG_WUTF); // __HAL_RCC_BACKUPRESET_RELEASE(); //备份区域复位结束 diff --git a/board/YS_STM32F407IGTx/BSP/Inc/mcu_init.h b/board/YS_STM32F407IGTx/BSP/Inc/mcu_init.h index f4212ae9..8a4112e1 100644 --- a/board/YS_STM32F407IGTx/BSP/Inc/mcu_init.h +++ b/board/YS_STM32F407IGTx/BSP/Inc/mcu_init.h @@ -8,7 +8,7 @@ #include "stm32f4xx_hal.h" #include "usart.h" #include "gpio.h" -#include "tos.h" +#include "tos_k.h" void board_init(void); void SystemClock_Config(void); diff --git a/board/YS_STM32F407IGTx/BSP/Src/stm32f4xx_it.c b/board/YS_STM32F407IGTx/BSP/Src/stm32f4xx_it.c index 47ae76c1..9eb5750d 100644 --- a/board/YS_STM32F407IGTx/BSP/Src/stm32f4xx_it.c +++ b/board/YS_STM32F407IGTx/BSP/Src/stm32f4xx_it.c @@ -21,7 +21,7 @@ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "stm32f4xx_it.h" -#include "tos.h" +#include "tos_k.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ @@ -33,7 +33,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ - + /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -63,7 +63,7 @@ /* USER CODE END EV */ /******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ +/* Cortex-M4 Processor Interruption and Exception Handlers */ /******************************************************************************/ /** * @brief This function handles Non maskable interrupt. @@ -186,11 +186,11 @@ void SysTick_Handler(void) /* USER CODE END SysTick_IRQn 0 */ HAL_IncTick(); - if(tos_knl_is_running()) + if(tos_knl_is_running()) { - tos_knl_irq_enter(); - tos_tick_handler(); - tos_knl_irq_leave(); + tos_knl_irq_enter(); + tos_tick_handler(); + tos_knl_irq_leave(); } /* USER CODE BEGIN SysTick_IRQn 1 */ diff --git a/components/connectivity/Bluetooth_5.0/porting/TencentOS_tiny/include/nimble/nimble_npl_os.h b/components/connectivity/Bluetooth_5.0/porting/TencentOS_tiny/include/nimble/nimble_npl_os.h index 31f0a0e6..3519ab7c 100644 --- a/components/connectivity/Bluetooth_5.0/porting/TencentOS_tiny/include/nimble/nimble_npl_os.h +++ b/components/connectivity/Bluetooth_5.0/porting/TencentOS_tiny/include/nimble/nimble_npl_os.h @@ -24,7 +24,7 @@ #include #include -#include "tos.h" +#include "tos_k.h" #ifdef __cplusplus extern "C" { diff --git a/components/connectivity/Bluetooth_5.0/porting/TencentOS_tiny/src/nimble_port_tencentos_tiny.c b/components/connectivity/Bluetooth_5.0/porting/TencentOS_tiny/src/nimble_port_tencentos_tiny.c index 0f6e50a8..f1d47a7e 100644 --- a/components/connectivity/Bluetooth_5.0/porting/TencentOS_tiny/src/nimble_port_tencentos_tiny.c +++ b/components/connectivity/Bluetooth_5.0/porting/TencentOS_tiny/src/nimble_port_tencentos_tiny.c @@ -18,7 +18,7 @@ */ #include -#include +#include #include "syscfg/syscfg.h" #include "nimble/nimble_port.h" diff --git a/components/connectivity/Bluetooth_5.0/porting/TencentOS_tiny/src/tencent_os_tiny_libc.c b/components/connectivity/Bluetooth_5.0/porting/TencentOS_tiny/src/tencent_os_tiny_libc.c index 8bb29a2a..b2cf3e52 100644 --- a/components/connectivity/Bluetooth_5.0/porting/TencentOS_tiny/src/tencent_os_tiny_libc.c +++ b/components/connectivity/Bluetooth_5.0/porting/TencentOS_tiny/src/tencent_os_tiny_libc.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #ifdef __CC_ARM /* avoid the heap and heap-using library functions supplied by arm */ diff --git a/components/connectivity/Eclipse-Paho-MQTT/3rdparty/include/MQTTPacket.h b/components/connectivity/Eclipse-Paho-MQTT/3rdparty/include/MQTTPacket.h index 4adfc443..ce7e10af 100644 --- a/components/connectivity/Eclipse-Paho-MQTT/3rdparty/include/MQTTPacket.h +++ b/components/connectivity/Eclipse-Paho-MQTT/3rdparty/include/MQTTPacket.h @@ -30,7 +30,7 @@ extern "C" { #define DLLExport __attribute__ ((visibility ("default"))) #else #define DLLImport - #define DLLExport + #define DLLExport #endif enum errors @@ -93,7 +93,7 @@ int MQTTstrlen(MQTTString mqttstring); #include "MQTTSubscribe.h" #include "MQTTUnsubscribe.h" #include "MQTTFormat.h" -#include "tos.h" +#include "tos_k.h" DLLExport int MQTTSerialize_ack(unsigned char* buf, int buflen, unsigned char type, unsigned char dup, unsigned short packetid); DLLExport int MQTTDeserialize_ack(unsigned char* packettype, unsigned char* dup, unsigned short* packetid, unsigned char* buf, int buflen); diff --git a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_os.c b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_os.c index f51a3c46..11193801 100644 --- a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_os.c +++ b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_os.c @@ -15,7 +15,7 @@ #include #include -#include "tos.h" +#include "tos_k.h" #include "qcloud.h" __QCLOUD_OSAL__ void osal_printf(const char *fmt, ...) diff --git a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_tcp_module.c b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_tcp_module.c index 37105107..ffe552e5 100644 --- a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_tcp_module.c +++ b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_tcp_module.c @@ -15,7 +15,7 @@ #include #include -#include "tos.h" +#include "tos_k.h" #include "sal_module_wrapper.h" #include "qcloud.h" diff --git a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_tcp_socket.c b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_tcp_socket.c index e5fd6f61..f8caece6 100644 --- a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_tcp_socket.c +++ b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_tcp_socket.c @@ -15,7 +15,7 @@ #include #include -#include "tos.h" +#include "tos_k.h" #include "qcloud.h" #include "lwip/api.h" diff --git a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_timer.c b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_timer.c index e6723c6f..55ae9205 100644 --- a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_timer.c +++ b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_timer.c @@ -17,10 +17,10 @@ extern "C" { #endif -#include +#include #include -#include "tos.h" +#include "tos_k.h" #include "qcloud.h" static char now_time_str[20] = {0}; diff --git a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_tls.c b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_tls.c index 6272d72a..0bac0686 100644 --- a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_tls.c +++ b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_tls.c @@ -21,7 +21,7 @@ extern "C" { #endif -#include "tos.h" +#include "tos_k.h" #include "qcloud.h" #include "mbedtls/ssl.h" diff --git a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_udp_module.c b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_udp_module.c index cec875ae..9e6ab56d 100644 --- a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_udp_module.c +++ b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_udp_module.c @@ -15,7 +15,7 @@ #include #include -#include "tos.h" +#include "tos_k.h" #include "sal_module_wrapper.h" #include "qcloud.h" diff --git a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_udp_socket.c b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_udp_socket.c index da785930..c44ce1c6 100644 --- a/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_udp_socket.c +++ b/components/connectivity/TencentCloud_SDK/source/src/port/TencentOS_tiny/osal_udp_socket.c @@ -15,7 +15,7 @@ #include #include -#include "tos.h" +#include "tos_k.h" #include "qcloud.h" #include "lwip/api.h" diff --git a/components/connectivity/iotkit-embedded-3.0.1/port/TencentOS_tiny/osal_os.c b/components/connectivity/iotkit-embedded-3.0.1/port/TencentOS_tiny/osal_os.c index d67b063a..13fa4ea6 100644 --- a/components/connectivity/iotkit-embedded-3.0.1/port/TencentOS_tiny/osal_os.c +++ b/components/connectivity/iotkit-embedded-3.0.1/port/TencentOS_tiny/osal_os.c @@ -15,7 +15,7 @@ #include #include -#include "tos.h" +#include "tos_k.h" #include "infra_defs.h" diff --git a/components/connectivity/iotkit-embedded-3.0.1/port/TencentOS_tiny/osal_tcp_module.c b/components/connectivity/iotkit-embedded-3.0.1/port/TencentOS_tiny/osal_tcp_module.c index 8f5555bc..9c18d17e 100644 --- a/components/connectivity/iotkit-embedded-3.0.1/port/TencentOS_tiny/osal_tcp_module.c +++ b/components/connectivity/iotkit-embedded-3.0.1/port/TencentOS_tiny/osal_tcp_module.c @@ -15,7 +15,7 @@ #include #include -#include "tos.h" +#include "tos_k.h" #include "sal_module_wrapper.h" #define PORT_BUFF_LEN 16 diff --git a/components/connectivity/iotkit-embedded-3.0.1/port/TencentOS_tiny/osal_timer.c b/components/connectivity/iotkit-embedded-3.0.1/port/TencentOS_tiny/osal_timer.c index 872f8f4f..76aecb0a 100644 --- a/components/connectivity/iotkit-embedded-3.0.1/port/TencentOS_tiny/osal_timer.c +++ b/components/connectivity/iotkit-embedded-3.0.1/port/TencentOS_tiny/osal_timer.c @@ -17,10 +17,10 @@ extern "C" { #endif -#include +#include #include -#include "tos.h" +#include "tos_k.h" uint32_t HAL_UptimeMs(void) { diff --git a/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_OS_tencentos_tiny.c b/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_OS_tencentos_tiny.c index a1bfcd3c..5e607f6c 100644 --- a/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_OS_tencentos_tiny.c +++ b/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_OS_tencentos_tiny.c @@ -17,7 +17,7 @@ #include #include "qcloud_iot_import.h" -#include "tos.h" +#include "tos_k.h" //#define PLATFORM_HAS_CMSIS diff --git a/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_TCP_module.c b/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_TCP_module.c index 0634303e..0ffb930d 100644 --- a/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_TCP_module.c +++ b/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_TCP_module.c @@ -22,7 +22,7 @@ #include "qcloud_iot_export_error.h" #include "qcloud_iot_common.h" -#include "tos.h" +#include "tos_k.h" #include "sal_module_wrapper.h" #define PORT_BUFF_LEN 16 diff --git a/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_Timer_tencentos_tiny.c b/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_Timer_tencentos_tiny.c index 673b806b..477aa8b3 100644 --- a/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_Timer_tencentos_tiny.c +++ b/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_Timer_tencentos_tiny.c @@ -23,7 +23,7 @@ extern "C" { #include #include "qcloud_iot_import.h" -#include "tos.h" +#include "tos_k.h" static char now_time_str[20] = {0}; diff --git a/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_UDP_module.c b/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_UDP_module.c index a2d68add..d674142a 100644 --- a/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_UDP_module.c +++ b/components/connectivity/qcloud-iot-explorer-sdk/port/TencentOS_tiny/HAL_UDP_module.c @@ -22,7 +22,7 @@ #include "qcloud_iot_export_log.h" #include "qcloud_iot_export_error.h" -#include "tos.h" +#include "tos_k.h" #include "sal_module_wrapper.h" #define PORT_BUFF_LEN 16 diff --git a/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_OS_tencentos_tiny.c b/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_OS_tencentos_tiny.c index a1bfcd3c..5e607f6c 100644 --- a/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_OS_tencentos_tiny.c +++ b/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_OS_tencentos_tiny.c @@ -17,7 +17,7 @@ #include #include "qcloud_iot_import.h" -#include "tos.h" +#include "tos_k.h" //#define PLATFORM_HAS_CMSIS diff --git a/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_TCP_module.c b/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_TCP_module.c index 0634303e..0ffb930d 100644 --- a/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_TCP_module.c +++ b/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_TCP_module.c @@ -22,7 +22,7 @@ #include "qcloud_iot_export_error.h" #include "qcloud_iot_common.h" -#include "tos.h" +#include "tos_k.h" #include "sal_module_wrapper.h" #define PORT_BUFF_LEN 16 diff --git a/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_Timer_tencentos_tiny.c b/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_Timer_tencentos_tiny.c index 673b806b..477aa8b3 100644 --- a/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_Timer_tencentos_tiny.c +++ b/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_Timer_tencentos_tiny.c @@ -23,7 +23,7 @@ extern "C" { #include #include "qcloud_iot_import.h" -#include "tos.h" +#include "tos_k.h" static char now_time_str[20] = {0}; diff --git a/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_UDP_module.c b/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_UDP_module.c index a2d68add..d674142a 100644 --- a/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_UDP_module.c +++ b/components/connectivity/qcloud-iot-hub-sdk-3.1.2/port/TencentOS_tiny/HAL_UDP_module.c @@ -22,7 +22,7 @@ #include "qcloud_iot_export_log.h" #include "qcloud_iot_export_error.h" -#include "tos.h" +#include "tos_k.h" #include "sal_module_wrapper.h" #define PORT_BUFF_LEN 16 diff --git a/components/fs/fatfs/3rdparty/ffsystem.c b/components/fs/fatfs/3rdparty/ffsystem.c index ca4ecc6c..afdcb9f5 100644 --- a/components/fs/fatfs/3rdparty/ffsystem.c +++ b/components/fs/fatfs/3rdparty/ffsystem.c @@ -3,7 +3,7 @@ /* (C)ChaN, 2018 */ /*------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #include "ff.h" diff --git a/components/fs/fatfs/wrapper/tos_ffsystem.c b/components/fs/fatfs/wrapper/tos_ffsystem.c index 1ad19b00..0a7cba42 100644 --- a/components/fs/fatfs/wrapper/tos_ffsystem.c +++ b/components/fs/fatfs/wrapper/tos_ffsystem.c @@ -3,7 +3,7 @@ /* (C)ChaN, 2018 */ /*------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #include "tos_ff.h" diff --git a/components/fs/kv/include/tos_kv.h b/components/fs/kv/include/tos_kv.h index 2caf0d47..c8069d36 100644 --- a/components/fs/kv/include/tos_kv.h +++ b/components/fs/kv/include/tos_kv.h @@ -18,7 +18,7 @@ #ifndef _TOS_KV_H_ #define _TOS_KV_H_ -#include "tos.h" +#include "tos_k.h" #include "tos_kv_err.h" #include "tos_kv_flash.h" @@ -112,12 +112,12 @@ typedef uint64_t kv_dword_t; // double word #define KV_BLK_FIRST_ITEM(blk_start) (blk_start + KV_BLK_HDR_SIZE) #define KV_BLK_NEXT(blk_start) (blk_start + KV_BLK_SIZE >= KV_FLASH_END ? KV_FLASH_START : blk_start + KV_BLK_SIZE) -#define KV_BLK_FOREACH_FROM(cur_blk, start_blk) \ +#define KV_BLK_FOR_EACH_FROM(cur_blk, start_blk) \ for (cur_blk = KV_BLK_NEXT(start_blk); \ cur_blk != start_blk; \ cur_blk = KV_BLK_NEXT(cur_blk)) -#define KV_BLK_FOREACH(cur_blk) \ +#define KV_BLK_FOR_EACH(cur_blk) \ for (cur_blk = KV_FLASH_START; \ cur_blk < KV_FLASH_END; \ cur_blk += KV_BLK_SIZE) diff --git a/components/fs/kv/tos_kv.c b/components/fs/kv/tos_kv.c index f99e76b1..f259c24b 100644 --- a/components/fs/kv/tos_kv.c +++ b/components/fs/kv/tos_kv.c @@ -136,7 +136,7 @@ __STATIC__ uint32_t kv_blk_next_fresh(void) uint32_t cur_blk; // we try to find a fresh block behind current block(take all the blocks as a ring) - KV_BLK_FOREACH_FROM(cur_blk, KV_MGR_WORKSPACE) { + KV_BLK_FOR_EACH_FROM(cur_blk, KV_MGR_WORKSPACE) { if (kv_blk_is_fresh(cur_blk)) { return cur_blk; } @@ -149,7 +149,7 @@ __STATIC__ uint32_t kv_blk_search_inuse(uint32_t item_size) { uint32_t cur_blk; - KV_BLK_FOREACH_FROM(cur_blk, KV_MGR_WORKSPACE) { + KV_BLK_FOR_EACH_FROM(cur_blk, KV_MGR_WORKSPACE) { if (kv_blk_is_inuse(cur_blk) && kv_blk_freesz_get(cur_blk) >= item_size) { return cur_blk; @@ -668,7 +668,7 @@ __STATIC__ kv_item_t *kv_item_find(const char *key) uint32_t cur_blk; kv_item_t *item; - KV_BLK_FOREACH(cur_blk) { + KV_BLK_FOR_EACH(cur_blk) { if (kv_blk_is_bad(cur_blk) || kv_blk_is_fresh(cur_blk)) { continue; @@ -699,7 +699,7 @@ __STATIC__ kv_item_t *kv_item_find_new_copy(kv_item_t *the_item) uint32_t cur_blk; kv_item_t *item; - KV_BLK_FOREACH(cur_blk) { + KV_BLK_FOR_EACH(cur_blk) { if (kv_blk_is_bad(cur_blk) || kv_blk_is_fresh(cur_blk)) { continue; @@ -893,7 +893,7 @@ __STATIC__ int kv_mgr_blk_index_rebuild(void) uint32_t cur_blk; int is_rebuild_done = K_FALSE; - KV_BLK_FOREACH(cur_blk) { + KV_BLK_FOR_EACH(cur_blk) { if (kv_blk_is_hanging(cur_blk)) { if (kv_mgr_index_build(cur_blk) == KV_ERR_NONE) { kv_blk_reset_hanging(cur_blk); @@ -921,7 +921,7 @@ __STATIC__ kv_err_t kv_mgr_workspace_locate(void) /* if no block inuse, we locate workspace in first fresh block else locate in first block inuse */ - KV_BLK_FOREACH(cur_blk) { + KV_BLK_FOR_EACH(cur_blk) { if (KV_MGR_BLK_NUM_INUSE == 0) { if (kv_blk_is_fresh(cur_blk)) { KV_MGR_WORKSPACE = cur_blk; @@ -942,7 +942,7 @@ __STATIC__ void kv_mgr_ctl_build(void) uint32_t cur_blk; kv_blk_hdr_t blk_hdr; - KV_BLK_FOREACH(cur_blk) { + KV_BLK_FOR_EACH(cur_blk) { if (kv_blk_hdr_read(cur_blk, &blk_hdr) != KV_ERR_NONE) { // sth must be wrong seriously with this block kv_blk_set_bad(cur_blk); @@ -1022,7 +1022,7 @@ __STATIC__ kv_err_t kv_gc(void) // there must be at least one fresh block left, make workspace pointer to the fresh one KV_MGR_WORKSPACE = kv_blk_next_fresh(); - KV_BLK_FOREACH(cur_blk) { + KV_BLK_FOR_EACH(cur_blk) { if (kv_blk_is_dirty(cur_blk)) { if (kv_do_gc(cur_blk) != KV_ERR_NONE) { // cannot do gc for this block, give others a try @@ -1171,7 +1171,7 @@ __DEBUG__ kv_err_t tos_kv_walkthru(void) printf("workspace: 0x%x [%d block]\n", KV_MGR_WORKSPACE, KV_BLK_ADDR2IDX(KV_MGR_WORKSPACE)); - KV_BLK_FOREACH(cur_blk) { + KV_BLK_FOR_EACH(cur_blk) { printf("[%d] block\n", i++); printf("addr: 0x%x\n", cur_blk); diff --git a/components/fs/vfs/include/tos_vfs.h b/components/fs/vfs/include/tos_vfs.h index 194ab2ec..c4de465f 100644 --- a/components/fs/vfs/include/tos_vfs.h +++ b/components/fs/vfs/include/tos_vfs.h @@ -1,7 +1,7 @@ #ifndef _TOS_VFS_H_ #define _TOS_VFS_H_ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_VFS_EN > 0u diff --git a/components/fs/vfs/tos_vfs_fs.c b/components/fs/vfs/tos_vfs_fs.c index f20395cc..c381fdc7 100644 --- a/components/fs/vfs/tos_vfs_fs.c +++ b/components/fs/vfs/tos_vfs_fs.c @@ -7,13 +7,11 @@ TOS_LIST_DEFINE(k_vfs_fsmap_list); __STATIC__ vfs_fsmap_t *vfs_fsmap_get(const char *fs_name) { - k_list_t *curr; char *name = K_NULL; vfs_fsmap_t *fsmap = K_NULL; - TOS_LIST_FOR_EACH(curr, &k_vfs_fsmap_list) { - fsmap = TOS_LIST_ENTRY(curr, vfs_fsmap_t, list); - name = (char *)fsmap->name; + TOS_LIST_FOR_EACH_ENTRY(fsmap, vfs_fsmap_t, list, &k_vfs_fsmap_list) { + name = (char *)fsmap->name; if (strlen(name) == strlen(fs_name) && strncmp(name, fs_name, strlen(name)) == 0) { return fsmap; diff --git a/components/fs/vfs/tos_vfs_inode.c b/components/fs/vfs/tos_vfs_inode.c index 371fffb4..b51fb5e5 100644 --- a/components/fs/vfs/tos_vfs_inode.c +++ b/components/fs/vfs/tos_vfs_inode.c @@ -20,15 +20,13 @@ __STATIC__ TOS_LIST_DEFINE(k_vfs_inode_list); */ __STATIC__ vfs_inode_t *vfs_inode_search(const char *path, const char **relative_path) { - k_list_t *curr; char *name = K_NULL; int path_len, name_len; vfs_inode_t *inode = K_NULL; path_len = strlen(path); - TOS_LIST_FOR_EACH(curr, &k_vfs_inode_list) { - inode = TOS_LIST_ENTRY(curr, vfs_inode_t, list); + TOS_LIST_FOR_EACH_ENTRY(inode, vfs_inode_t, list, &k_vfs_inode_list) { name = (char *)inode->name; name_len = strlen(name); diff --git a/components/security/mbedtls/wrapper/src/net_module_alt.c b/components/security/mbedtls/wrapper/src/net_module_alt.c index 46b2c4f2..758ea1da 100644 --- a/components/security/mbedtls/wrapper/src/net_module_alt.c +++ b/components/security/mbedtls/wrapper/src/net_module_alt.c @@ -12,7 +12,7 @@ #include #endif -#include "tos.h" +#include "tos_k.h" #include "mbedtls/net_sockets.h" #include "sal_module_wrapper.h" diff --git a/components/security/mbedtls/wrapper/src/net_sockets_alt.c b/components/security/mbedtls/wrapper/src/net_sockets_alt.c index 0d03db56..b84b35f7 100644 --- a/components/security/mbedtls/wrapper/src/net_sockets_alt.c +++ b/components/security/mbedtls/wrapper/src/net_sockets_alt.c @@ -12,7 +12,7 @@ #include #endif -#include "tos.h" +#include "tos_k.h" #include "mbedtls/net_sockets.h" #include "lwip/api.h" #include "lwip/sockets.h" diff --git a/components/security/mbedtls/wrapper/src/timing_alt.c b/components/security/mbedtls/wrapper/src/timing_alt.c index 5939f986..4ee89a78 100644 --- a/components/security/mbedtls/wrapper/src/timing_alt.c +++ b/components/security/mbedtls/wrapper/src/timing_alt.c @@ -4,7 +4,7 @@ #include MBEDTLS_CONFIG_FILE #endif -#include "tos.h" +#include "tos_k.h" #include "timing_alt.h" unsigned long mbedtls_timing_get_timer(struct mbedtls_timing_hr_time *val, int reset) diff --git a/components/utils/JSON/src/cJSON.c b/components/utils/JSON/src/cJSON.c index 1ebfe5c1..131a171c 100644 --- a/components/utils/JSON/src/cJSON.c +++ b/components/utils/JSON/src/cJSON.c @@ -48,7 +48,7 @@ #include #include "cJSON.h" -#include +#include #ifdef ENABLE_LOCALES #include diff --git a/devices/bc35_28_95/bc35_28_95.c b/devices/bc35_28_95/bc35_28_95.c index b500cfad..c0637282 100644 --- a/devices/bc35_28_95/bc35_28_95.c +++ b/devices/bc35_28_95/bc35_28_95.c @@ -1,5 +1,5 @@ #include "bc35_28_95.h" -#include "tos.h" +#include "tos_k.h" #include "tos_at.h" #include "tos_hal.h" #include "sal_module_wrapper.h" diff --git a/devices/bc35_28_95_lwm2m/bc35_28_95_lwm2m.c b/devices/bc35_28_95_lwm2m/bc35_28_95_lwm2m.c index 588d18f3..7c498a4b 100644 --- a/devices/bc35_28_95_lwm2m/bc35_28_95_lwm2m.c +++ b/devices/bc35_28_95_lwm2m/bc35_28_95_lwm2m.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ #include "bc35_28_95_lwm2m.h" -#include "tos.h" +#include "tos_k.h" #include "tos_at.h" #include "tos_hal.h" #include "sal_module_wrapper.h" @@ -60,7 +60,7 @@ static int bc35_28_95_reset(void){ return 0; } } - return -1; + return -1; } static int bc35_28_95_echo_close(void) @@ -197,7 +197,7 @@ static int bc35_28_95_autoconnect_config(char mode) } else{ tos_at_cmd_exec(&echo, 1000, "AT+NCONFIG=AUTOCONNECT,FALSE\r\n"); - } + } if(echo.status == AT_ECHO_STATUS_OK){ return 0; } @@ -213,7 +213,7 @@ static int bc35_28_95_print_IMEI(void) { return 0; } return -1; - + } static int bc35_28_95_print_CIMI(void) { at_echo_t echo; @@ -223,8 +223,8 @@ static int bc35_28_95_print_CIMI(void) { return 0; } return -1; - -} + +} static int bc35_28_95_print_NBAND(void) { at_echo_t echo; tos_at_echo_create(&echo, NULL, 0, NULL); @@ -233,7 +233,7 @@ static int bc35_28_95_print_NBAND(void) { return 0; } return -1; - + } static int bc35_28_95_lwm2m_init(void) @@ -246,7 +246,7 @@ static int bc35_28_95_lwm2m_init(void) } if(bc35_28_95_autoconnect_config(0)!=0){ printf("autoconnect false FAILED\n"); - return -1; + return -1; }; if (bc35_28_95_cfun_set(0) != 0) { printf("close_cfun FAILED\n"); @@ -254,7 +254,7 @@ static int bc35_28_95_lwm2m_init(void) } if(bc35_28_95_nband_set(5)!=0){ printf("nband_set FAILED\n"); - return -1; + return -1; } printf("Init bc35_28_95 Done\n" ); @@ -272,11 +272,11 @@ static int bc35_28_95_lwm2m_connect(const char *ip, const char *port, sal_proto_ if (echo.status != AT_ECHO_STATUS_OK) { return -1; } - + if(bc35_28_95_reset()!=0){ printf("reset FAILED\n"); - return -1; - } + return -1; + } tos_task_delay(1000); bc35_28_95_check_cfun(); bc35_28_95_cfun_set(1); @@ -289,7 +289,7 @@ static int bc35_28_95_lwm2m_connect(const char *ip, const char *port, sal_proto_ if (bc35_28_95_signal_quality_check() != 0) { printf("check csq FAILED\n"); return -1; - } + } while (try++ < 10) { if (bc35_28_95_check_net()==0){ is_connected = 1; @@ -297,7 +297,7 @@ static int bc35_28_95_lwm2m_connect(const char *ip, const char *port, sal_proto_ } tos_task_delay(1000); continue; - } + } if(is_connected){ id=0; sscanf(echo.buffer, "%d", &id); @@ -305,7 +305,7 @@ static int bc35_28_95_lwm2m_connect(const char *ip, const char *port, sal_proto_ if (id == -1) { return -1; } - } + } else{ return -1; } @@ -362,16 +362,16 @@ __STATIC__ void bc35_28_95_lwm2m_incoming_data_process(void) } data_len = data_len * 10 + (data - '0'); } - + if (data_len > sizeof(incoming_data_buffer)/2) { data_len = sizeof(incoming_data_buffer)/2; - } + } if (tos_at_uart_read(incoming_data_buffer, data_len*2) != data_len*2) { return; } - + tos_at_channel_write(channel_id, incoming_data_buffer, data_len*2); } diff --git a/devices/m5310a/m5310a.c b/devices/m5310a/m5310a.c index 23f5c966..c5cb3ff1 100644 --- a/devices/m5310a/m5310a.c +++ b/devices/m5310a/m5310a.c @@ -1,5 +1,5 @@ #include "m5310a.h" -#include "tos.h" +#include "tos_k.h" #include "tos_at.h" #include "tos_hal.h" #include "sal_module_wrapper.h" diff --git a/doc/code/2.2 task manager/main.c b/doc/code/2.2 task manager/main.c index e44ab59c..7fceb516 100644 --- a/doc/code/2.2 task manager/main.c +++ b/doc/code/2.2 task manager/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_PRIO4 512 diff --git a/doc/code/2.3.1 mutex/main.c b/doc/code/2.3.1 mutex/main.c index 24ea96ea..b8ef8e07 100644 --- a/doc/code/2.3.1 mutex/main.c +++ b/doc/code/2.3.1 mutex/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_WRITER 512 diff --git a/doc/code/2.3.2 semaphore/main.c b/doc/code/2.3.2 semaphore/main.c index 434e550a..4e591920 100644 --- a/doc/code/2.3.2 semaphore/main.c +++ b/doc/code/2.3.2 semaphore/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_PRODUCER 512 diff --git a/doc/code/2.3.3 event/main.c b/doc/code/2.3.3 event/main.c index 0ba672f8..7382c693 100644 --- a/doc/code/2.3.3 event/main.c +++ b/doc/code/2.3.3 event/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_LISTENER 512 diff --git a/doc/code/2.3.4 completion/main.c b/doc/code/2.3.4 completion/main.c index 054d51c8..b387d8de 100644 --- a/doc/code/2.3.4 completion/main.c +++ b/doc/code/2.3.4 completion/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_WAIT 512 diff --git a/doc/code/2.3.5 countdownlatch/main.c b/doc/code/2.3.5 countdownlatch/main.c index 1f493a42..f39a5cd4 100644 --- a/doc/code/2.3.5 countdownlatch/main.c +++ b/doc/code/2.3.5 countdownlatch/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_WIZARD 512 diff --git a/doc/code/2.3.6 message queue/main.c b/doc/code/2.3.6 message queue/main.c index 788a7c38..36513d34 100644 --- a/doc/code/2.3.6 message queue/main.c +++ b/doc/code/2.3.6 message queue/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_RECEIVER 512 diff --git a/doc/code/2.3.7 mail queue/main.c b/doc/code/2.3.7 mail queue/main.c index 99b2fbb5..fa0876f2 100644 --- a/doc/code/2.3.7 mail queue/main.c +++ b/doc/code/2.3.7 mail queue/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_RECEIVER 512 diff --git a/doc/code/2.3.8 priority message queue/main.c b/doc/code/2.3.8 priority message queue/main.c index c3de617a..30a24ce6 100644 --- a/doc/code/2.3.8 priority message queue/main.c +++ b/doc/code/2.3.8 priority message queue/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_RECEIVER 512 diff --git a/doc/code/2.3.9 priority mail queue/main.c b/doc/code/2.3.9 priority mail queue/main.c index e7ce4d53..d8139ac2 100644 --- a/doc/code/2.3.9 priority mail queue/main.c +++ b/doc/code/2.3.9 priority mail queue/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_RECEIVER 512 diff --git a/doc/code/2.4.1 mmheap/main.c b/doc/code/2.4.1 mmheap/main.c index faa20d51..527cda43 100644 --- a/doc/code/2.4.1 mmheap/main.c +++ b/doc/code/2.4.1 mmheap/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_DEMO 512 @@ -29,7 +29,7 @@ void entry_task_demo(void *arg) p = tos_mmheap_alloc(0x30); if (p) { printf("alloc: %x\n", (cpu_addr_t)p); - } + } } else if (i == 4) { p_aligned = tos_mmheap_aligned_alloc(0x50, 16); if (p_aligned) { diff --git a/doc/code/2.4.2 mmblk/main.c b/doc/code/2.4.2 mmblk/main.c index 4925fc9c..4561ee4f 100644 --- a/doc/code/2.4.2 mmblk/main.c +++ b/doc/code/2.4.2 mmblk/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_DEMO 512 diff --git a/doc/code/2.5 time/main.c b/doc/code/2.5 time/main.c index 3e08493b..913143df 100644 --- a/doc/code/2.5 time/main.c +++ b/doc/code/2.5 time/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_DEMO 512 diff --git a/doc/code/2.6 timer/main.c b/doc/code/2.6 timer/main.c index 9e0c2268..c4d46808 100644 --- a/doc/code/2.6 timer/main.c +++ b/doc/code/2.6 timer/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_DEMO 512 diff --git a/doc/code/2.7 robin/main.c b/doc/code/2.7 robin/main.c index c511f8f5..22b96714 100644 --- a/doc/code/2.7 robin/main.c +++ b/doc/code/2.7 robin/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_DEMO 512 diff --git a/doc/code/2.8.1 ring queue/main.c b/doc/code/2.8.1 ring queue/main.c index 94c8b934..80dc59b7 100644 --- a/doc/code/2.8.1 ring queue/main.c +++ b/doc/code/2.8.1 ring queue/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_DEMO 512 diff --git a/doc/code/2.8.2 char fifo/main.c b/doc/code/2.8.2 char fifo/main.c index 51789e2a..73bb1308 100644 --- a/doc/code/2.8.2 char fifo/main.c +++ b/doc/code/2.8.2 char fifo/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_DEMO 512 diff --git a/doc/code/2.8.4 priority queue/main.c b/doc/code/2.8.4 priority queue/main.c index 9e4a7deb..81683911 100644 --- a/doc/code/2.8.4 priority queue/main.c +++ b/doc/code/2.8.4 priority queue/main.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "mcu_init.h" #define STK_SIZE_TASK_DEMO 512 diff --git a/examples/aliyun_iotkit_csdk_mqtt/aliyun_iotkit_csdk_mqtt.c b/examples/aliyun_iotkit_csdk_mqtt/aliyun_iotkit_csdk_mqtt.c index 229b30e3..8faeabad 100644 --- a/examples/aliyun_iotkit_csdk_mqtt/aliyun_iotkit_csdk_mqtt.c +++ b/examples/aliyun_iotkit_csdk_mqtt/aliyun_iotkit_csdk_mqtt.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #define USE_ESP8266 diff --git a/examples/fatfs/fatfs_sample.c b/examples/fatfs/fatfs_sample.c index e1b13001..40092aee 100644 --- a/examples/fatfs/fatfs_sample.c +++ b/examples/fatfs/fatfs_sample.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tos_hal.h" #include "ff.h" @@ -51,7 +51,7 @@ void application_entry(void *arg) printf("read error: %d\n", res); } f_close(&file); - + f_sync(&file); } diff --git a/examples/fatfs_through_vfs/fatfs_through_vfs_sample.c b/examples/fatfs_through_vfs/fatfs_through_vfs_sample.c index 0ddf059d..c01b484d 100644 --- a/examples/fatfs_through_vfs/fatfs_through_vfs_sample.c +++ b/examples/fatfs_through_vfs/fatfs_through_vfs_sample.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tos_hal.h" #include "ff.h" #include "tos_vfs.h" diff --git a/examples/lvgl_gui_demo/lvgl_demo.c b/examples/lvgl_gui_demo/lvgl_demo.c index 9de0ad01..7a403c04 100644 --- a/examples/lvgl_gui_demo/lvgl_demo.c +++ b/examples/lvgl_gui_demo/lvgl_demo.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "lvgl/lvgl.h" #include "tft.h" #include "touchpad.h" @@ -22,7 +22,7 @@ void application_entry(void *arg) lv_init(); tft_init(); touchpad_init(); - + //benchmark_create(); //sysmon_create(); //terminal_create(); @@ -37,7 +37,7 @@ void application_entry(void *arg) { tos_task_delay(5); lv_task_handler(); - } + } } diff --git a/examples/nimble_scanner/main.c b/examples/nimble_scanner/main.c index 15199d60..8a025b75 100644 --- a/examples/nimble_scanner/main.c +++ b/examples/nimble_scanner/main.c @@ -124,11 +124,9 @@ void nimble_scan_item_display(nimble_scan_item_t *item) void nimble_scan_info_list_display(void) { - k_list_t *curr; nimble_scan_item_t *iter; - TOS_LIST_FOR_EACH(curr, &scan_entry) { - iter = TOS_LIST_ENTRY(curr, nimble_scan_item_t, list); + TOS_LIST_FOR_EACH_ENTRY(iter, nimble_scan_item_t, list, &scan_entry) { nimble_scan_item_display(iter); } } @@ -140,11 +138,9 @@ nimble_scan_item_t *nimble_scan_item_alloc(void) int nimble_scan_item_is_exist(ble_addr_t *addr) { - k_list_t *curr; nimble_scan_item_t *iter; - TOS_LIST_FOR_EACH(curr, &free_entry) { - iter = TOS_LIST_ENTRY(curr, nimble_scan_item_t, list); + TOS_LIST_FOR_EACH_ENTRY(iter, nimble_scan_item_t, list, &free_entry) { if (ble_addr_cmp(&addr, &iter->addr) == 0) { return K_TRUE; } diff --git a/examples/qcloud_iot_explorer_sdk_data_template/qcloud_iot_hub_sdk_explorer.c b/examples/qcloud_iot_explorer_sdk_data_template/qcloud_iot_hub_sdk_explorer.c index 784ccec9..533a7a72 100644 --- a/examples/qcloud_iot_explorer_sdk_data_template/qcloud_iot_hub_sdk_explorer.c +++ b/examples/qcloud_iot_explorer_sdk_data_template/qcloud_iot_hub_sdk_explorer.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" /* 鐢ㄦ埛鏍规嵁鑷繁鐨勫簳灞傞氫俊閾捐矾鏉ラ厤缃瀹 * 濡傛灉鏄熀浜庝互澶綉lwip鐨勯摼璺紝杩欓噷搴旇瀹氫箟 USE_LWIP @@ -30,7 +30,7 @@ void application_entry(void *arg) esp8266_sal_init(HAL_UART_PORT_0); esp8266_join_ap("SheldonDai", "srnr6x9xbhmb0"); #endif - + #ifdef USE_NB_BC35 extern int bc35_28_95_sal_init(hal_uart_port_t uart_port); bc35_28_95_sal_init(HAL_UART_PORT_0); diff --git a/examples/qcloud_iot_hub_sdk_coap/qcloud_iot_hub_sdk_coap.c b/examples/qcloud_iot_hub_sdk_coap/qcloud_iot_hub_sdk_coap.c index 88f1e4da..9d312bff 100644 --- a/examples/qcloud_iot_hub_sdk_coap/qcloud_iot_hub_sdk_coap.c +++ b/examples/qcloud_iot_hub_sdk_coap/qcloud_iot_hub_sdk_coap.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" /* 鐢ㄦ埛鏍规嵁鑷繁鐨勫簳灞傞氫俊閾捐矾鏉ラ厤缃瀹 * 濡傛灉鏄熀浜庝互澶綉lwip鐨勯摼璺紝杩欓噷搴旇瀹氫箟 USE_LWIP diff --git a/examples/qcloud_iot_hub_sdk_mqtt/qcloud_iot_hub_sdk_mqtt.c b/examples/qcloud_iot_hub_sdk_mqtt/qcloud_iot_hub_sdk_mqtt.c index 83aa822c..0b2da9ce 100644 --- a/examples/qcloud_iot_hub_sdk_mqtt/qcloud_iot_hub_sdk_mqtt.c +++ b/examples/qcloud_iot_hub_sdk_mqtt/qcloud_iot_hub_sdk_mqtt.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" /* 鐢ㄦ埛鏍规嵁鑷繁鐨勫簳灞傞氫俊閾捐矾鏉ラ厤缃瀹 * 濡傛灉鏄熀浜庝互澶綉lwip鐨勯摼璺紝杩欓噷搴旇瀹氫箟 USE_LWIP diff --git a/examples/tencent_cloud_sdk_coap/coap_sample.c b/examples/tencent_cloud_sdk_coap/coap_sample.c index ea573609..5b5b5018 100644 --- a/examples/tencent_cloud_sdk_coap/coap_sample.c +++ b/examples/tencent_cloud_sdk_coap/coap_sample.c @@ -13,7 +13,7 @@ * */ -#include "tos.h" +#include "tos_k.h" #include "qcloud.h" static void response_message_callback(void *msg, void *context) diff --git a/examples/tencent_cloud_sdk_coap/tencent_cloud_sdk_coap.c b/examples/tencent_cloud_sdk_coap/tencent_cloud_sdk_coap.c index b60ef978..1efb4147 100644 --- a/examples/tencent_cloud_sdk_coap/tencent_cloud_sdk_coap.c +++ b/examples/tencent_cloud_sdk_coap/tencent_cloud_sdk_coap.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" /* 鐢ㄦ埛鏍规嵁鑷繁鐨勫簳灞傞氫俊閾捐矾鏉ラ厤缃瀹 * 濡傛灉鏄熀浜庝互澶綉lwip鐨勯摼璺紝杩欓噷搴旇瀹氫箟 USE_LWIP diff --git a/examples/tencent_cloud_sdk_data_template/light_data_template_sample.c b/examples/tencent_cloud_sdk_data_template/light_data_template_sample.c index 3c6a82e9..a0083c26 100644 --- a/examples/tencent_cloud_sdk_data_template/light_data_template_sample.c +++ b/examples/tencent_cloud_sdk_data_template/light_data_template_sample.c @@ -14,7 +14,7 @@ */ #include "qcloud.h" -#include "tos.h" +#include "tos_k.h" #if (QCLOUD_CFG_EVENT_EN > 0u) diff --git a/examples/tencent_cloud_sdk_data_template/tencent_cloud_sdk_explorer.c b/examples/tencent_cloud_sdk_data_template/tencent_cloud_sdk_explorer.c index 784ccec9..533a7a72 100644 --- a/examples/tencent_cloud_sdk_data_template/tencent_cloud_sdk_explorer.c +++ b/examples/tencent_cloud_sdk_data_template/tencent_cloud_sdk_explorer.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" /* 鐢ㄦ埛鏍规嵁鑷繁鐨勫簳灞傞氫俊閾捐矾鏉ラ厤缃瀹 * 濡傛灉鏄熀浜庝互澶綉lwip鐨勯摼璺紝杩欓噷搴旇瀹氫箟 USE_LWIP @@ -30,7 +30,7 @@ void application_entry(void *arg) esp8266_sal_init(HAL_UART_PORT_0); esp8266_join_ap("SheldonDai", "srnr6x9xbhmb0"); #endif - + #ifdef USE_NB_BC35 extern int bc35_28_95_sal_init(hal_uart_port_t uart_port); bc35_28_95_sal_init(HAL_UART_PORT_0); diff --git a/examples/tencent_cloud_sdk_mqtt/mqtt_sample.c b/examples/tencent_cloud_sdk_mqtt/mqtt_sample.c index 6233bc77..33c66a18 100644 --- a/examples/tencent_cloud_sdk_mqtt/mqtt_sample.c +++ b/examples/tencent_cloud_sdk_mqtt/mqtt_sample.c @@ -20,7 +20,7 @@ #include #include -#include "tos.h" +#include "tos_k.h" #include "qcloud.h" diff --git a/examples/tencent_cloud_sdk_mqtt/tencent_cloud_sdk_mqtt.c b/examples/tencent_cloud_sdk_mqtt/tencent_cloud_sdk_mqtt.c index 83aa822c..0b2da9ce 100644 --- a/examples/tencent_cloud_sdk_mqtt/tencent_cloud_sdk_mqtt.c +++ b/examples/tencent_cloud_sdk_mqtt/tencent_cloud_sdk_mqtt.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" /* 鐢ㄦ埛鏍规嵁鑷繁鐨勫簳灞傞氫俊閾捐矾鏉ラ厤缃瀹 * 濡傛灉鏄熀浜庝互澶綉lwip鐨勯摼璺紝杩欓噷搴旇瀹氫箟 USE_LWIP diff --git a/examples/tencent_firmware_mqtt/tencent_firmware_mqtt.c b/examples/tencent_firmware_mqtt/tencent_firmware_mqtt.c index 67a6f3e5..e204cb4f 100644 --- a/examples/tencent_firmware_mqtt/tencent_firmware_mqtt.c +++ b/examples/tencent_firmware_mqtt/tencent_firmware_mqtt.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "esp8266_tencent_firmware.h" #include "tencent_firmware_module_wrapper.h" diff --git a/kernel/core/include/tos.h b/kernel/core/include/tos_k.h similarity index 95% rename from kernel/core/include/tos.h rename to kernel/core/include/tos_k.h index 54ec9471..9324e4d4 100644 --- a/kernel/core/include/tos.h +++ b/kernel/core/include/tos_k.h @@ -15,8 +15,8 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#ifndef _TOS_H_ -#define _TOS_H_ +#ifndef _TOS_K_H_ +#define _TOS_K_H_ #include #include @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -59,5 +60,5 @@ #include #include -#endif /* _TOS_H_ */ +#endif /* _TOS_K_H_ */ diff --git a/kernel/core/include/tos_list.h b/kernel/core/include/tos_list.h index 63c086d5..c77934bd 100644 --- a/kernel/core/include/tos_list.h +++ b/kernel/core/include/tos_list.h @@ -29,8 +29,8 @@ typedef struct k_list_node_st { #define TOS_LIST_DEFINE(list) \ k_list_t list = { &(list), &(list) } -#define TOS_LIST_ENTRY(list, type, field) \ - TOS_CONTAINER_OF_FIELD(list, type, field) +#define TOS_LIST_ENTRY(node, type, field) \ + TOS_CONTAINER_OF_FIELD(node, type, field) #define TOS_LIST_FIRST_ENTRY(list, type, field) \ TOS_LIST_ENTRY((list)->next, type, field) @@ -53,6 +53,28 @@ typedef struct k_list_node_st { curr != (list); \ curr = next, next = curr->prev) +#define TOS_LIST_FOR_EACH_ENTRY(entry, type, field, list) \ + for (entry = TOS_LIST_ENTRY((list)->next, type, field); \ + &entry->field != (list); \ + entry = TOS_LIST_ENTRY(entry->field.next, type, field)) + +#define TOS_LIST_FOR_EACH_ENTRY_REVERSE(entry, type, field, list) \ + for (entry = TOS_LIST_ENTRY((list)->prev, type, field); \ + &entry->field != (list); \ + entry = TOS_LIST_ENTRY(entry->field.prev, type, field)) + +#define TOS_LIST_FOR_EACH_ENTRY_SAFE(entry, tmp, type, field, list) \ + for (entry = TOS_LIST_ENTRY((list)->next, type, field), \ + tmp = TOS_LIST_ENTRY(entry->field.next, type, field); \ + &entry->field != (list); \ + entry = tmp, tmp = TOS_LIST_ENTRY(entry->field.next, type, field)) + +#define TOS_LIST_FOR_EACH_ENTRY_SAFE_REVERSE(entry, tmp, type, field, list) \ + for (entry = TOS_LIST_ENTRY((list)->prev, type, field), \ + tmp = TOS_LIST_ENTRY(entry->field.prev, type, field); \ + &entry->field != (list); \ + entry = tmp, tmp = TOS_LIST_ENTRY(entry->field.prev, type, field)) + __STATIC_INLINE__ void _list_add(k_list_t *node, k_list_t *prev, k_list_t *next) { next->prev = node; @@ -67,9 +89,9 @@ __STATIC_INLINE__ void _list_del(k_list_t *prev, k_list_t *next) prev->next = next; } -__STATIC_INLINE__ void _list_del_entry(k_list_t *entry) +__STATIC_INLINE__ void _list_del_node(k_list_t *node) { - _list_del(entry->prev, entry->next); + _list_del(node->prev, node->next); } __API__ __STATIC_INLINE__ void tos_list_init(k_list_t *list) @@ -88,26 +110,26 @@ __API__ __STATIC_INLINE__ void tos_list_add_tail(k_list_t *node, k_list_t *list) _list_add(node, list->prev, list); } -__API__ __STATIC_INLINE__ void tos_list_del(k_list_t *entry) +__API__ __STATIC_INLINE__ void tos_list_del(k_list_t *node) { - _list_del(entry->prev, entry->next); + _list_del(node->prev, node->next); } -__API__ __STATIC_INLINE__ void tos_list_del_init(k_list_t *entry) +__API__ __STATIC_INLINE__ void tos_list_del_init(k_list_t *node) { - _list_del_entry(entry); - tos_list_init(entry); + _list_del_node(node); + tos_list_init(node); } __API__ __STATIC_INLINE__ void tos_list_move(k_list_t *node, k_list_t *list) { - _list_del_entry(node); + _list_del_node(node); tos_list_add(node, list); } __API__ __STATIC_INLINE__ void tos_list_move_tail(k_list_t *node, k_list_t *list) { - _list_del_entry(node); + _list_del_node(node); tos_list_add_tail(node, list); } diff --git a/kernel/core/include/tos_slist.h b/kernel/core/include/tos_slist.h new file mode 100644 index 00000000..9d319f13 --- /dev/null +++ b/kernel/core/include/tos_slist.h @@ -0,0 +1,156 @@ +#ifndef _TOS_SLIST_H_ +#define _TOS_SLIST_H_ + +typedef struct k_slist_node_st { + struct k_slist_node_st *next; +} k_slist_t; + +#define TOS_SLIST_NODE(node) \ + { K_NULL } + +#define TOS_SLIST_DEFINE(slist) \ + k_slist_t slist = { K_NULL } + +#define TOS_SLIST_ENTRY(node, type, field) \ + TOS_CONTAINER_OF_FIELD(node, type, field) + +#define TOS_SLIST_FIRST_ENTRY(slist, type, field) \ + TOS_SLIST_ENTRY((slist)->next, type, field) + +#define TOS_SLIST_FIRST_ENTRY_OR_NULL(slist, type, field) \ + (tos_slist_empty(slist) ? K_NULL : TOS_SLIST_FIRST_ENTRY(slist, type, field)) + +#define TOS_SLIST_FOR_EACH(curr, slist) \ + for (curr = (slist)->next; curr; curr = curr->next) + +#define TOS_SLIST_FOR_EACH_SAFE(curr, next, slist) \ + for (curr = (slist)->next, next = curr->next; curr; \ + curr = next, next = curr->next) + +#define TOS_SLIST_FOR_EACH_ENTRY(entry, type, field, slist) \ + for (entry = TOS_SLIST_ENTRY((slist)->next, type, field); \ + &entry->field; \ + entry = TOS_SLIST_ENTRY(entry->field.next, type, field)) + +#define TOS_SLIST_FOR_EACH_ENTRY_SAFE(entry, tmp, type, field, slist) \ + for (entry = TOS_SLIST_ENTRY((slist)->next, type, field), \ + tmp = TOS_SLIST_ENTRY(entry->field.next, type, field); \ + &entry->field; \ + entry = tmp, tmp = TOS_SLIST_ENTRY(entry->field.next, type, field)) + +__API__ __STATIC_INLINE__ void tos_slist_init(k_slist_t *slist) +{ + slist->next = K_NULL; +} + +__API__ __STATIC_INLINE__ k_slist_t *tos_slist_head(k_slist_t *slist) +{ + return slist->next; +} + +__API__ __STATIC_INLINE__ k_slist_t *tos_slist_tail(k_slist_t *slist) +{ + if (!slist->next) { + return K_NULL; + } + + while (slist->next) { + slist = slist->next; + } + + return slist; +} + +__API__ __STATIC_INLINE__ void tos_slist_add_head(k_slist_t *node, k_slist_t *slist) +{ + node->next = slist->next; + slist->next = node; +} + +__API__ __STATIC_INLINE__ void tos_slist_add_tail(k_slist_t *node, k_slist_t *slist) +{ + node->next = K_NULL; + + while (slist->next) { + slist = slist->next; + } + + tos_slist_add_head(node, slist); +} + +__API__ __STATIC_INLINE__ void tos_slist_insert(k_slist_t *next_node, k_slist_t *new_node, k_slist_t *slist) +{ + if (!next_node) { + tos_slist_add_tail(new_node, slist); + return; + } + + while (slist->next) { + if (slist->next == next_node) { + slist->next = new_node; + new_node->next = next_node; + } + + slist = slist->next; + } +} + +__API__ __STATIC_INLINE__ k_slist_t *tos_slist_del_head(k_slist_t *slist) +{ + k_slist_t *head; + + if (!slist->next) { + return K_NULL; + } + + head = slist->next; + slist->next = head->next; + head->next = K_NULL; + + return head; +} + +__API__ __STATIC_INLINE__ k_slist_t *tos_slist_del_tail(k_slist_t *slist) +{ + while (slist->next) { + if (!slist->next->next) { + return tos_slist_del_head(slist); + } + + slist = slist->next; + } + + return K_NULL; +} + +__API__ __STATIC_INLINE__ void tos_slist_del(k_slist_t *node, k_slist_t *slist) +{ + while (slist->next) { + if (slist->next == node) { + slist->next = node->next; + break; + } + + slist = slist->next; + } +} + +__API__ __STATIC_INLINE__ int tos_slist_length(k_slist_t *slist) +{ + int len = 0; + k_slist_t *iter; + + TOS_SLIST_FOR_EACH(iter, slist) { + ++len; + } + + return len; +} + +__API__ __STATIC_INLINE__ int tos_slist_empty(k_slist_t *slist) +{ + return !slist->next; +} + +#endif /* _TOS_SLIST_H_ */ + diff --git a/kernel/core/tos_binary_heap.c b/kernel/core/tos_binary_heap.c index 922696da..f569a215 100644 --- a/kernel/core/tos_binary_heap.c +++ b/kernel/core/tos_binary_heap.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" __STATIC_INLINE__ void bin_heap_item_copy_to(k_bin_heap_t *bin_heap, void *item_out, size_t *item_size) { diff --git a/kernel/core/tos_char_fifo.c b/kernel/core/tos_char_fifo.c index 82931df3..c86d837b 100644 --- a/kernel/core/tos_char_fifo.c +++ b/kernel/core/tos_char_fifo.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" __API__ k_err_t tos_chr_fifo_create(k_chr_fifo_t *chr_fifo, void *buffer, size_t size) { diff --git a/kernel/core/tos_completion.c b/kernel/core/tos_completion.c index 3987970e..6b19c043 100644 --- a/kernel/core/tos_completion.c +++ b/kernel/core/tos_completion.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_COMPLETION_EN > 0u diff --git a/kernel/core/tos_countdownlatch.c b/kernel/core/tos_countdownlatch.c index 5e752dd8..6092a6f2 100644 --- a/kernel/core/tos_countdownlatch.c +++ b/kernel/core/tos_countdownlatch.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_COUNTDOWNLATCH_EN > 0u diff --git a/kernel/core/tos_event.c b/kernel/core/tos_event.c index f5dea560..3dd45f72 100644 --- a/kernel/core/tos_event.c +++ b/kernel/core/tos_event.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_EVENT_EN > 0 @@ -134,8 +134,7 @@ __API__ k_err_t tos_event_pend(k_event_t *event, k_event_flag_t flag_expect, k_e __STATIC__ k_err_t event_do_post(k_event_t *event, k_event_flag_t flag, opt_event_post_t opt_post) { TOS_CPU_CPSR_ALLOC(); - k_task_t *task; - k_list_t *curr, *next; + k_task_t *task, *tmp; TOS_PTR_SANITY_CHECK(event); TOS_OBJ_VERIFY(event, KNL_OBJ_TYPE_EVENT); @@ -148,11 +147,9 @@ __STATIC__ k_err_t event_do_post(k_event_t *event, k_event_flag_t flag, opt_even TOS_CPU_INT_DISABLE(); - TOS_LIST_FOR_EACH_SAFE(curr, next, &event->pend_obj.list) { - task = TOS_LIST_ENTRY(curr, k_task_t, pend_list); - + TOS_LIST_FOR_EACH_ENTRY_SAFE(task, tmp, k_task_t, pend_list, &event->pend_obj.list) { if (event_is_match(event->flag, task->flag_expect, task->flag_match, task->opt_event_pend)) { - pend_task_wakeup(TOS_LIST_ENTRY(curr, k_task_t, pend_list), PEND_STATE_POST); + pend_task_wakeup(task, PEND_STATE_POST); // if anyone pending the event has set the TOS_OPT_EVENT_PEND_CLR, then no wakeup for the others pendig for the event. if (task->opt_event_pend & TOS_OPT_EVENT_PEND_CLR) { diff --git a/kernel/core/tos_global.c b/kernel/core/tos_global.c index 631cfd33..5c8527c2 100644 --- a/kernel/core/tos_global.c +++ b/kernel/core/tos_global.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include k_nesting_t k_irq_nest_cnt = (k_nesting_t)0; k_nesting_t k_sched_lock_nest_cnt = (k_nesting_t)0; diff --git a/kernel/core/tos_mail_queue.c b/kernel/core/tos_mail_queue.c index 1508578f..db2f216c 100644 --- a/kernel/core/tos_mail_queue.c +++ b/kernel/core/tos_mail_queue.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_MAIL_QUEUE_EN > 0u @@ -207,7 +207,7 @@ __STATIC__ k_err_t mail_q_do_post(k_mail_q_t *mail_q, void *mail_buf, size_t mai { TOS_CPU_CPSR_ALLOC(); k_err_t err; - k_list_t *curr, *next; + k_task_t *task, *tmp; TOS_PTR_SANITY_CHECK(mail_q); TOS_PTR_SANITY_CHECK(mail_buf); @@ -229,9 +229,8 @@ __STATIC__ k_err_t mail_q_do_post(k_mail_q_t *mail_q, void *mail_buf, size_t mai mail_task_recv(TOS_LIST_FIRST_ENTRY(&mail_q->pend_obj.list, k_task_t, pend_list), mail_buf, mail_size); } else { // OPT_POST_ALL - TOS_LIST_FOR_EACH_SAFE(curr, next, &mail_q->pend_obj.list) { - mail_task_recv(TOS_LIST_ENTRY(curr, k_task_t, pend_list), - mail_buf, mail_size); + TOS_LIST_FOR_EACH_ENTRY_SAFE(task, tmp, k_task_t, pend_list, &mail_q->pend_obj.list) { + mail_task_recv(task, mail_buf, mail_size); } } diff --git a/kernel/core/tos_message_queue.c b/kernel/core/tos_message_queue.c index 55d93bbc..f6f32490 100644 --- a/kernel/core/tos_message_queue.c +++ b/kernel/core/tos_message_queue.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ - #include "tos.h" + #include "tos_k.h" #if TOS_CFG_MESSAGE_QUEUE_EN > 0u @@ -205,7 +205,7 @@ __STATIC__ k_err_t msg_q_do_post(k_msg_q_t *msg_q, void *msg_ptr, opt_post_t opt { TOS_CPU_CPSR_ALLOC(); k_err_t err; - k_list_t *curr, *next; + k_task_t *task, *tmp; TOS_PTR_SANITY_CHECK(msg_q); TOS_OBJ_VERIFY(msg_q, KNL_OBJ_TYPE_MESSAGE_QUEUE); @@ -225,8 +225,8 @@ __STATIC__ k_err_t msg_q_do_post(k_msg_q_t *msg_q, void *msg_ptr, opt_post_t opt if (opt == OPT_POST_ONE) { msg_q_task_recv(TOS_LIST_FIRST_ENTRY(&msg_q->pend_obj.list, k_task_t, pend_list), msg_ptr); } else { // OPT_POST_ALL - TOS_LIST_FOR_EACH_SAFE(curr, next, &msg_q->pend_obj.list) { - msg_q_task_recv(TOS_LIST_ENTRY(curr, k_task_t, pend_list), msg_ptr); + TOS_LIST_FOR_EACH_ENTRY_SAFE(task, tmp, k_task_t, pend_list, &msg_q->pend_obj.list) { + msg_q_task_recv(task, msg_ptr); } } diff --git a/kernel/core/tos_mmblk.c b/kernel/core/tos_mmblk.c index 7795f1e1..28525b88 100644 --- a/kernel/core/tos_mmblk.c +++ b/kernel/core/tos_mmblk.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include "tos_k.h" #if TOS_CFG_MMBLK_EN > 0u diff --git a/kernel/core/tos_mmheap.c b/kernel/core/tos_mmheap.c index bb98073a..be895cac 100644 --- a/kernel/core/tos_mmheap.c +++ b/kernel/core/tos_mmheap.c @@ -52,7 +52,7 @@ ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include "tos_k.h" #if TOS_CFG_MMHEAP_EN > 0u diff --git a/kernel/core/tos_mutex.c b/kernel/core/tos_mutex.c index 4d68be03..4bf33079 100644 --- a/kernel/core/tos_mutex.c +++ b/kernel/core/tos_mutex.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_MUTEX_EN > 0u diff --git a/kernel/core/tos_pend.c b/kernel/core/tos_pend.c index a3b6bcda..aa90052b 100644 --- a/kernel/core/tos_pend.c +++ b/kernel/core/tos_pend.c @@ -15,24 +15,21 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" __STATIC__ void pend_list_add(k_task_t *task, pend_obj_t *pend_obj) { - k_list_t *curr, *pend_list; k_task_t *iter; - pend_list = &pend_obj->list; /* keep priority in descending order, the boss(task with highest priority, numerically smallest) always comes first */ - TOS_LIST_FOR_EACH(curr, pend_list) { - iter = TOS_LIST_ENTRY(curr, k_task_t, pend_list); + TOS_LIST_FOR_EACH_ENTRY(iter, k_task_t, pend_list, &pend_obj->list) { if (task->prio < iter->prio) { break; } } - tos_list_add_tail(&task->pend_list, curr); + tos_list_add_tail(&task->pend_list, &iter->pend_list); // remember me, you may use me someday task->pending_obj = pend_obj; @@ -137,10 +134,10 @@ __KERNEL__ void pend_wakeup_one(pend_obj_t *object, pend_state_t state) __KERNEL__ void pend_wakeup_all(pend_obj_t *object, pend_state_t state) { - k_list_t *curr, *next; + k_task_t *task, *tmp; - TOS_LIST_FOR_EACH_SAFE(curr, next, &object->list) { - pend_task_wakeup(TOS_LIST_ENTRY(curr, k_task_t, pend_list), state); + TOS_LIST_FOR_EACH_ENTRY_SAFE(task, tmp, k_task_t, pend_list, &object->list) { + pend_task_wakeup(task, state); } } diff --git a/kernel/core/tos_priority_mail_queue.c b/kernel/core/tos_priority_mail_queue.c index 396ecf7d..a7a8bf55 100644 --- a/kernel/core/tos_priority_mail_queue.c +++ b/kernel/core/tos_priority_mail_queue.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_PRIORITY_MAIL_QUEUE_EN > 0u @@ -208,7 +208,7 @@ __STATIC__ k_err_t prio_mail_q_do_post(k_prio_mail_q_t *prio_mail_q, void *mail_ { TOS_CPU_CPSR_ALLOC(); k_err_t err; - k_list_t *curr, *next; + k_task_t *task, *tmp; TOS_PTR_SANITY_CHECK(prio_mail_q); TOS_PTR_SANITY_CHECK(mail_buf); @@ -230,9 +230,8 @@ __STATIC__ k_err_t prio_mail_q_do_post(k_prio_mail_q_t *prio_mail_q, void *mail_ prio_mail_task_recv(TOS_LIST_FIRST_ENTRY(&prio_mail_q->pend_obj.list, k_task_t, pend_list), mail_buf, mail_size); } else { // OPT_POST_ALL - TOS_LIST_FOR_EACH_SAFE(curr, next, &prio_mail_q->pend_obj.list) { - prio_mail_task_recv(TOS_LIST_ENTRY(curr, k_task_t, pend_list), - mail_buf, mail_size); + TOS_LIST_FOR_EACH_ENTRY_SAFE(task, tmp, k_task_t, pend_list, &prio_mail_q->pend_obj.list) { + prio_mail_task_recv(task, mail_buf, mail_size); } } diff --git a/kernel/core/tos_priority_message_queue.c b/kernel/core/tos_priority_message_queue.c index 34ef1549..b1f24a14 100644 --- a/kernel/core/tos_priority_message_queue.c +++ b/kernel/core/tos_priority_message_queue.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ - #include "tos.h" + #include "tos_k.h" #if TOS_CFG_PRIORITY_MESSAGE_QUEUE_EN > 0u @@ -208,7 +208,7 @@ __STATIC__ k_err_t prio_msg_q_do_post(k_prio_msg_q_t *prio_msg_q, void *msg_ptr, { TOS_CPU_CPSR_ALLOC(); k_err_t err; - k_list_t *curr, *next; + k_task_t *task, *tmp; TOS_PTR_SANITY_CHECK(prio_msg_q); TOS_OBJ_VERIFY(prio_msg_q, KNL_OBJ_TYPE_PRIORITY_MESSAGE_QUEUE); @@ -228,8 +228,8 @@ __STATIC__ k_err_t prio_msg_q_do_post(k_prio_msg_q_t *prio_msg_q, void *msg_ptr, if (opt == OPT_POST_ONE) { prio_msg_q_task_recv(TOS_LIST_FIRST_ENTRY(&prio_msg_q->pend_obj.list, k_task_t, pend_list), msg_ptr); } else { // OPT_POST_ALL - TOS_LIST_FOR_EACH_SAFE(curr, next, &prio_msg_q->pend_obj.list) { - prio_msg_q_task_recv(TOS_LIST_ENTRY(curr, k_task_t, pend_list), msg_ptr); + TOS_LIST_FOR_EACH_ENTRY_SAFE(task, tmp, k_task_t, pend_list, &prio_msg_q->pend_obj.list) { + prio_msg_q_task_recv(task, msg_ptr); } } diff --git a/kernel/core/tos_priority_queue.c b/kernel/core/tos_priority_queue.c index b31ad18f..9195e776 100644 --- a/kernel/core/tos_priority_queue.c +++ b/kernel/core/tos_priority_queue.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" __STATIC_INLINE__ void prio_q_item_copy_to(k_prio_q_t *prio_q, void *item_out, size_t *item_size, prio_q_slot_t slot) { diff --git a/kernel/core/tos_ring_queue.c b/kernel/core/tos_ring_queue.c index 50236869..8876f906 100644 --- a/kernel/core/tos_ring_queue.c +++ b/kernel/core/tos_ring_queue.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" __STATIC_INLINE__ void ring_q_item_copy_to(k_ring_q_t *ring_q, void *item_out, size_t *item_size) { diff --git a/kernel/core/tos_robin.c b/kernel/core/tos_robin.c index 91108509..04592a17 100644 --- a/kernel/core/tos_robin.c +++ b/kernel/core/tos_robin.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_ROUND_ROBIN_EN > 0u diff --git a/kernel/core/tos_sched.c b/kernel/core/tos_sched.c index 6a886302..830f878c 100644 --- a/kernel/core/tos_sched.c +++ b/kernel/core/tos_sched.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include "tos_k.h" __STATIC__ k_prio_t readyqueue_prio_highest_get(void) { diff --git a/kernel/core/tos_sem.c b/kernel/core/tos_sem.c index 415a1590..bb69fa75 100644 --- a/kernel/core/tos_sem.c +++ b/kernel/core/tos_sem.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_SEM_EN > 0u diff --git a/kernel/core/tos_sys.c b/kernel/core/tos_sys.c index 8f283346..447d17b8 100644 --- a/kernel/core/tos_sys.c +++ b/kernel/core/tos_sys.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include "tos_k.h" __API__ k_err_t tos_knl_init(void) { diff --git a/kernel/core/tos_task.c b/kernel/core/tos_task.c index e278d560..9a98117e 100644 --- a/kernel/core/tos_task.c +++ b/kernel/core/tos_task.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include "tos_k.h" __STATIC_INLINE__ void task_reset(k_task_t *task) { @@ -59,26 +59,25 @@ __STATIC__ void task_exit(void) #if TOS_CFG_MUTEX_EN > 0u __STATIC__ k_prio_t task_highest_pending_prio_get(k_task_t *task) { - k_list_t *curr; k_mutex_t *mutex; k_prio_t prio, highest_prio_pending = K_TASK_PRIO_INVALID; - TOS_LIST_FOR_EACH(curr, &task->mutex_own_list) { - mutex = TOS_LIST_ENTRY(curr, k_mutex_t, owner_anchor); - prio = pend_highest_pending_prio_get(&mutex->pend_obj); + TOS_LIST_FOR_EACH_ENTRY(mutex, k_mutex_t, owner_anchor, &task->mutex_own_list) { + prio = pend_highest_pending_prio_get(&mutex->pend_obj); if (prio < highest_prio_pending) { highest_prio_pending = prio; } } + return highest_prio_pending; } __STATIC__ void task_mutex_release(k_task_t *task) { - k_list_t *curr, *next; + k_mutex_t *mutex, *tmp; - TOS_LIST_FOR_EACH_SAFE(curr, next, &task->mutex_own_list) { - mutex_release(TOS_LIST_ENTRY(curr, k_mutex_t, owner_anchor)); + TOS_LIST_FOR_EACH_ENTRY_SAFE(mutex, tmp, k_mutex_t, owner_anchor, &task->mutex_own_list) { + mutex_release(mutex); } } #endif @@ -225,13 +224,11 @@ __STATIC__ void task_free(k_task_t *task) __KERNEL__ void task_free_all(void) { TOS_CPU_CPSR_ALLOC(); - k_task_t *task; - k_list_t *curr, *next; + k_task_t *task, *tmp; TOS_CPU_INT_DISABLE(); - TOS_LIST_FOR_EACH_SAFE(curr, next, &k_dead_task_list) { - task = TOS_LIST_ENTRY(curr, k_task_t, dead_list); + TOS_LIST_FOR_EACH_ENTRY_SAFE(task, tmp, k_task_t, dead_list, &k_dead_task_list) { tos_list_del(&task->dead_list); task_free(task); } @@ -551,7 +548,6 @@ __API__ void tos_task_walkthru(k_task_walker_t walker) { TOS_CPU_CPSR_ALLOC(); k_task_t *task; - k_list_t *curr; if (!walker) { return; @@ -559,8 +555,7 @@ __API__ void tos_task_walkthru(k_task_walker_t walker) TOS_CPU_INT_DISABLE(); - TOS_LIST_FOR_EACH(curr, &k_stat_list) { - task = TOS_LIST_ENTRY(curr, k_task_t, stat_list); + TOS_LIST_FOR_EACH_ENTRY(task, k_task_t, stat_list, &k_stat_list) { walker(task); } diff --git a/kernel/core/tos_tick.c b/kernel/core/tos_tick.c index d7272117..7bc314e2 100644 --- a/kernel/core/tos_tick.c +++ b/kernel/core/tos_tick.c @@ -15,12 +15,11 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include "tos_k.h" __STATIC__ void tick_task_place(k_task_t *task, k_tick_t timeout) { TOS_CPU_CPSR_ALLOC(); - k_list_t *curr; k_task_t *curr_task = K_NULL; k_tick_t curr_expires, prev_expires = (k_tick_t)0u; @@ -28,8 +27,7 @@ __STATIC__ void tick_task_place(k_task_t *task, k_tick_t timeout) task->tick_expires = timeout; - TOS_LIST_FOR_EACH(curr, &k_tick_list) { - curr_task = TOS_LIST_ENTRY(curr, k_task_t, tick_list); + TOS_LIST_FOR_EACH_ENTRY(curr_task, k_task_t, tick_list, &k_tick_list) { curr_expires = prev_expires + curr_task->tick_expires; if (task->tick_expires < curr_expires) { @@ -42,10 +40,10 @@ __STATIC__ void tick_task_place(k_task_t *task, k_tick_t timeout) prev_expires = curr_expires; } task->tick_expires -= prev_expires; - if (curr != &k_tick_list && curr_task) { + if (&curr_task->tick_list != &k_tick_list) { curr_task->tick_expires -= task->tick_expires; } - tos_list_add_tail(&task->tick_list, curr); + tos_list_add_tail(&task->tick_list, &curr_task->tick_list); TOS_CPU_INT_ENABLE(); } @@ -86,8 +84,7 @@ __KERNEL__ void tick_list_remove(k_task_t *task) __KERNEL__ void tick_update(k_tick_t tick) { TOS_CPU_CPSR_ALLOC(); - k_task_t *first, *task; - k_list_t *curr, *next; + k_task_t *first, *task, *tmp; TOS_CPU_INT_DISABLE(); k_tick_count += tick; @@ -106,8 +103,7 @@ __KERNEL__ void tick_update(k_tick_t tick) return; } - TOS_LIST_FOR_EACH_SAFE(curr, next, &k_tick_list) { - task = TOS_LIST_ENTRY(curr, k_task_t, tick_list); + TOS_LIST_FOR_EACH_ENTRY_SAFE(task, tmp, k_task_t, tick_list, &k_tick_list) { if (task->tick_expires > (k_tick_t)0u) { break; } diff --git a/kernel/core/tos_time.c b/kernel/core/tos_time.c index 004bfe33..16ccf34b 100644 --- a/kernel/core/tos_time.c +++ b/kernel/core/tos_time.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include "tos_k.h" __API__ k_tick_t tos_systick_get(void) { diff --git a/kernel/core/tos_timer.c b/kernel/core/tos_timer.c index c61991dd..371024a8 100644 --- a/kernel/core/tos_timer.c +++ b/kernel/core/tos_timer.c @@ -15,27 +15,25 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include +#include "tos_k.h" #if TOS_CFG_TIMER_EN > 0u __STATIC__ void timer_place(k_timer_t *tmr) { TOS_CPU_CPSR_ALLOC(); - k_list_t *curr; k_timer_t *iter = K_NULL; TOS_CPU_INT_DISABLE(); tmr->expires += k_tick_count; - TOS_LIST_FOR_EACH(curr, &k_timer_ctl.list) { - iter = TOS_LIST_ENTRY(curr, k_timer_t, list); + TOS_LIST_FOR_EACH_ENTRY(iter, k_timer_t, list, &k_timer_ctl.list) { if (tmr->expires < iter->expires) { break; } } - tos_list_add_tail(&tmr->list, curr); + tos_list_add_tail(&tmr->list, &iter->list); if (k_timer_ctl.list.next == &tmr->list) { // we are the first guy now @@ -281,8 +279,7 @@ __KERNEL__ k_tick_t timer_next_expires_get(void) __KERNEL__ void timer_update(void) { - k_timer_t *tmr; - k_list_t *curr, *next; + k_timer_t *tmr, *tmp; if (k_timer_ctl.next_expires < k_tick_count) { return; @@ -290,8 +287,7 @@ __KERNEL__ void timer_update(void) tos_knl_sched_lock(); - TOS_LIST_FOR_EACH_SAFE(curr, next, &k_timer_ctl.list) { - tmr = TOS_LIST_ENTRY(curr, k_timer_t, list); + TOS_LIST_FOR_EACH_ENTRY_SAFE(tmr, tmp, k_timer_t, list, &k_timer_ctl.list) { if (tmr->expires > k_tick_count) { break; } @@ -316,8 +312,7 @@ __KERNEL__ void timer_update(void) __STATIC__ void timer_task_entry(void *arg) { - k_timer_t *tmr; - k_list_t *curr, *next; + k_timer_t *tmr, *tmp; k_tick_t next_expires; arg = arg; // make compiler happy @@ -331,8 +326,7 @@ __STATIC__ void timer_task_entry(void *arg) tos_knl_sched_lock(); - TOS_LIST_FOR_EACH_SAFE(curr, next, &k_timer_ctl.list) { - tmr = TOS_LIST_ENTRY(curr, k_timer_t, list); + TOS_LIST_FOR_EACH_ENTRY_SAFE(tmr, tmp, k_timer_t, list, &k_timer_ctl.list) { if (tmr->expires > k_tick_count) { // not yet break; } diff --git a/kernel/evtdrv/include/tos_evtdrv.h b/kernel/evtdrv/include/tos_evtdrv.h index e63067c9..772a23bd 100644 --- a/kernel/evtdrv/include/tos_evtdrv.h +++ b/kernel/evtdrv/include/tos_evtdrv.h @@ -18,7 +18,7 @@ #ifndef _TOS_EVTDRV_H_ #define _TOS_EVTDRV_H_ -#include "tos.h" +#include "tos_k.h" #include "tos_evtdrv_err.h" #include "tos_evtdrv_types.h" #include "tos_evtdrv_event.h" diff --git a/kernel/evtdrv/tos_evtdrv_msg.c b/kernel/evtdrv/tos_evtdrv_msg.c index 476d59d4..8caa1e54 100644 --- a/kernel/evtdrv/tos_evtdrv_msg.c +++ b/kernel/evtdrv/tos_evtdrv_msg.c @@ -89,13 +89,11 @@ __STATIC_INLINE__ void evtdrv_msg_prepare4use(evtdrv_msg_hdr_t *msg_hdr) __API__ evtdrv_msg_body_t tos_evtdrv_msg_recv(void) { TOS_CPU_CPSR_ALLOC(); - k_list_t *curr, *next; - evtdrv_msg_hdr_t *msg_hdr = K_NULL; + evtdrv_msg_hdr_t *msg_hdr, *tmp; TOS_CPU_INT_DISABLE(); - TOS_LIST_FOR_EACH_SAFE(curr, next, &evtdrv_msg_list) { - msg_hdr = TOS_LIST_ENTRY(curr, evtdrv_msg_hdr_t, list); + TOS_LIST_FOR_EACH_ENTRY_SAFE(msg_hdr, tmp, evtdrv_msg_hdr_t, list, &evtdrv_msg_list) { if (!evtdrv_task_is_self(msg_hdr->dst_task_id)) { continue; } diff --git a/kernel/evtdrv/tos_evtdrv_timer.c b/kernel/evtdrv/tos_evtdrv_timer.c index 91448616..0d8c42d7 100644 --- a/kernel/evtdrv/tos_evtdrv_timer.c +++ b/kernel/evtdrv/tos_evtdrv_timer.c @@ -22,20 +22,17 @@ __STATIC__ void evtdrv_timer_place(evtdrv_timer_t *tmr, evtdrv_tick_t timeout) { TOS_CPU_CPSR_ALLOC(); - k_list_t *curr; evtdrv_timer_t *curr_tmr; TOS_CPU_INT_DISABLE(); tmr->expires = tos_evtdrv_systick_get() + timeout; - TOS_LIST_FOR_EACH(curr, &evtdrv_timer_list) { - curr_tmr = TOS_LIST_ENTRY(curr, evtdrv_timer_t, list); - + TOS_LIST_FOR_EACH_ENTRY(curr_tmr, evtdrv_timer_t, list, &evtdrv_timer_list) { if (tmr->expires < curr_tmr->expires) { break; } } - tos_list_add_tail(&tmr->list, curr); + tos_list_add_tail(&tmr->list, &curr_tmr->list); TOS_CPU_INT_ENABLE(); } @@ -101,13 +98,11 @@ __API__ evtdrv_err_t tos_evtdrv_timer_stop(evtdrv_timer_t *tmr) __KERNEL__ void evtdrv_timer_update(void) { TOS_CPU_CPSR_ALLOC(); - evtdrv_timer_t *tmr; - k_list_t *curr, *next; + evtdrv_timer_t *tmr, *tmp; TOS_CPU_INT_DISABLE(); - TOS_LIST_FOR_EACH_SAFE(curr, next, &evtdrv_timer_list) { - tmr = TOS_LIST_ENTRY(curr, evtdrv_timer_t, list); + TOS_LIST_FOR_EACH_ENTRY_SAFE(tmr, tmp, evtdrv_timer_t, list, &evtdrv_timer_list) { if (tmr->expires > tos_evtdrv_systick_get()) { break; } diff --git a/kernel/hal/include/tos_hal.h b/kernel/hal/include/tos_hal.h index 100f99af..bf4250d2 100644 --- a/kernel/hal/include/tos_hal.h +++ b/kernel/hal/include/tos_hal.h @@ -18,7 +18,7 @@ #ifndef _TOS_HAL_H_ #define _TOS_HAL_H_ -#include "tos.h" +#include "tos_k.h" #include "tos_hal_sd.h" #include "tos_hal_uart.h" diff --git a/kernel/pm/tos_pm.c b/kernel/pm/tos_pm.c index af33ce96..91ea4e97 100644 --- a/kernel/pm/tos_pm.c +++ b/kernel/pm/tos_pm.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_PWR_MGR_EN > 0u diff --git a/kernel/pm/tos_tickless.c b/kernel/pm/tos_tickless.c index 53fa021d..3a6e1f49 100644 --- a/kernel/pm/tos_tickless.c +++ b/kernel/pm/tos_tickless.c @@ -15,7 +15,7 @@ * within TencentOS. *---------------------------------------------------------------------------*/ -#include "tos.h" +#include "tos_k.h" #if TOS_CFG_TICKLESS_EN > 0u diff --git a/net/at/include/tos_at.h b/net/at/include/tos_at.h index e08934df..afaef871 100644 --- a/net/at/include/tos_at.h +++ b/net/at/include/tos_at.h @@ -18,7 +18,7 @@ #ifndef _TOS_AT_H_ #define _TOS_AT_H_ -#include "tos.h" +#include "tos_k.h" #include "tos_at_utils.h" #include "tos_hal.h" diff --git a/net/at/src/tos_at_utils.c b/net/at/src/tos_at_utils.c index 78193d87..8e254034 100644 --- a/net/at/src/tos_at_utils.c +++ b/net/at/src/tos_at_utils.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tos_at.h" void at_delay(k_tick_t tick) diff --git a/net/lwip/port/include/arch/sys_arch.h b/net/lwip/port/include/arch/sys_arch.h index de94441e..7796a0a2 100644 --- a/net/lwip/port/include/arch/sys_arch.h +++ b/net/lwip/port/include/arch/sys_arch.h @@ -38,7 +38,7 @@ #error "NO_SYS need to be set to 0 to use threaded API" #endif -#include +#include #ifdef __cplusplus extern "C" { diff --git a/osal/cmsis_os/cmsis_os.h b/osal/cmsis_os/cmsis_os.h index a4b84ad1..333860d2 100644 --- a/osal/cmsis_os/cmsis_os.h +++ b/osal/cmsis_os/cmsis_os.h @@ -151,7 +151,7 @@ used throughout the whole project. #include #include -#include "tos.h" +#include "tos_k.h" #ifdef __cplusplus extern "C" { diff --git a/platform/hal/nationz/N32G020XX/src/tos_hal_uart.c b/platform/hal/nationz/N32G020XX/src/tos_hal_uart.c index 4df18881..a0155111 100644 --- a/platform/hal/nationz/N32G020XX/src/tos_hal_uart.c +++ b/platform/hal/nationz/N32G020XX/src/tos_hal_uart.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tos_hal.h" #include "n32g020xx_common.h" #include "n32g020xx.h" @@ -53,7 +53,7 @@ __API__ int tos_hal_uart_init(hal_uart_t *uart, hal_uart_port_t port) uart->private_uart = &huart2; huart0.channel = UART_CH2; uart->private_uart = &huart2; - } + } return 0; } diff --git a/platform/hal/st/stm32f1xx/src/tos_hal_uart.c b/platform/hal/st/stm32f1xx/src/tos_hal_uart.c index 688eca24..17228874 100644 --- a/platform/hal/st/stm32f1xx/src/tos_hal_uart.c +++ b/platform/hal/st/stm32f1xx/src/tos_hal_uart.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tos_hal.h" #include "stm32f1xx_hal.h" #include "usart.h" diff --git a/platform/hal/st/stm32f4xx/src/tos_hal_sd.c b/platform/hal/st/stm32f4xx/src/tos_hal_sd.c index 5943487e..eb954101 100644 --- a/platform/hal/st/stm32f4xx/src/tos_hal_sd.c +++ b/platform/hal/st/stm32f4xx/src/tos_hal_sd.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tos_hal.h" #include "stm32f4xx_hal.h" #include "sdio.h" diff --git a/platform/hal/st/stm32f4xx/src/tos_hal_uart.c b/platform/hal/st/stm32f4xx/src/tos_hal_uart.c index 475a6672..051dca5a 100644 --- a/platform/hal/st/stm32f4xx/src/tos_hal_uart.c +++ b/platform/hal/st/stm32f4xx/src/tos_hal_uart.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tos_hal.h" #include "stm32f4xx_hal.h" #include "usart.h" diff --git a/platform/hal/st/stm32f7xx/tos_hal_sd.c b/platform/hal/st/stm32f7xx/tos_hal_sd.c index 555ba454..e925bfba 100644 --- a/platform/hal/st/stm32f7xx/tos_hal_sd.c +++ b/platform/hal/st/stm32f7xx/tos_hal_sd.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tos_hal.h" #include "stm32f7xx_hal.h" #include "sdmmc.h" diff --git a/platform/hal/st/stm32l0xx/src/tos_hal_uart.c b/platform/hal/st/stm32l0xx/src/tos_hal_uart.c index 55b0e359..91307f21 100644 --- a/platform/hal/st/stm32l0xx/src/tos_hal_uart.c +++ b/platform/hal/st/stm32l0xx/src/tos_hal_uart.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tos_hal.h" #include "stm32l0xx_hal.h" #include "usart.h" @@ -14,7 +14,7 @@ __API__ int tos_hal_uart_init(hal_uart_t *uart, hal_uart_port_t port) } else if (port == HAL_UART_PORT_2) { uart->private_uart = &huart2; MX_USART2_UART_Init(); - } + } return 0; } diff --git a/platform/hal/st/stm32l4xx/src/tos_hal_uart.c b/platform/hal/st/stm32l4xx/src/tos_hal_uart.c index 9e530519..e0109ad0 100644 --- a/platform/hal/st/stm32l4xx/src/tos_hal_uart.c +++ b/platform/hal/st/stm32l4xx/src/tos_hal_uart.c @@ -1,4 +1,4 @@ -#include "tos.h" +#include "tos_k.h" #include "tos_hal.h" #include "stm32l4xx_hal.h" #include "usart.h" diff --git a/platform/vendor_bsp/hdsc/HC32L136_DDL_Rev1.0.0/driver/inc/ddl.h b/platform/vendor_bsp/hdsc/HC32L136_DDL_Rev1.0.0/driver/inc/ddl.h index 71e63f4f..45a10113 100644 --- a/platform/vendor_bsp/hdsc/HC32L136_DDL_Rev1.0.0/driver/inc/ddl.h +++ b/platform/vendor_bsp/hdsc/HC32L136_DDL_Rev1.0.0/driver/inc/ddl.h @@ -60,7 +60,7 @@ #include "system_hc32l136.h" #include "sysctrl.h" //#include "gpio.h" -#include "tos.h" +#include "tos_k.h" /* C binding of definitions if building with C++ compiler */ #ifdef __cplusplus extern "C" @@ -110,7 +110,7 @@ extern "C" ****************************************************************************** ** \brief IRQ name definition for all type MCUs ******************************************************************************/ - + #define PORTA_IRQHandler(void) IRQ000_Handler(void) #define PORTB_IRQHandler(void) IRQ001_Handler(void) #define PORTC_IRQHandler(void) IRQ002_Handler(void) diff --git a/test/include/test/test.h b/test/include/test/test.h index bdf3eb4e..adedfcb7 100644 --- a/test/include/test/test.h +++ b/test/include/test/test.h @@ -1,7 +1,7 @@ #ifndef _TEST_H_ #define _TEST_H_ -#include "tos.h" +#include "tos_k.h" #include "test/test_utils.h" #include "test/test_task.h" #include "test/test_mutex.h"