remvoe main as thread of cmsis rtx for portability.
Keil & lpcxpresso4 host_cmsis_rtx work well
This commit is contained in:
+6
@@ -115,6 +115,9 @@ _declare_box8 (mp_stk, OS_STKSIZE*4, OS_TASK_CNT-OS_PRIV_CNT+1);
|
||||
uint32_t const mp_stk_size = sizeof(mp_stk);
|
||||
|
||||
/* Memory pool for user specified stack allocation (+main, +timer) */
|
||||
#ifdef __CODE_RED
|
||||
__attribute__ (( section(".data.$RAM2") )) // overflow RamLoc32
|
||||
#endif
|
||||
uint64_t os_stack_mem[2+OS_PRIV_CNT+(OS_STACK_SZ/8)];
|
||||
uint32_t const os_stack_sz = sizeof(os_stack_mem);
|
||||
|
||||
@@ -234,6 +237,7 @@ __attribute__((used)) void _mutex_release (OS_ID *mutex) {
|
||||
* RTX Startup
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#if osFeature_MainThread
|
||||
/* Main Thread definition */
|
||||
extern int main (void);
|
||||
osThreadDef_t os_thread_def_main = {(os_pthread)main, osPriorityNormal, 1, 4*OS_MAINSTKSIZE };
|
||||
@@ -373,6 +377,8 @@ __noreturn __stackless void __cmain(void) {
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* end of file
|
||||
|
||||
Vendored
+1
-1
@@ -141,7 +141,7 @@ used throughout the whole project.
|
||||
|
||||
|
||||
/// \note MUST REMAIN UNCHANGED: \b osFeature_xxx shall be consistent in every CMSIS-RTOS.
|
||||
#define osFeature_MainThread 1 ///< main thread 1=main can be thread, 0=not available
|
||||
#define osFeature_MainThread 0 ///< main thread 1=main can be thread, 0=not available
|
||||
#define osFeature_Pool 1 ///< Memory Pools: 1=available, 0=not available
|
||||
#define osFeature_MailQ 1 ///< Mail Queues: 1=available, 0=not available
|
||||
#define osFeature_MessageQ 1 ///< Message Queues: 1=available, 0=not available
|
||||
|
||||
Vendored
+3
-3
@@ -55,14 +55,14 @@
|
||||
// <i> Defines default stack size for threads with osThreadDef stacksz = 0
|
||||
// <i> Default: 200
|
||||
#ifndef OS_STKSIZE
|
||||
#define OS_STKSIZE 50
|
||||
#define OS_STKSIZE 200
|
||||
#endif
|
||||
|
||||
// <o>Main Thread stack size [bytes] <64-4096:8><#/4>
|
||||
// <i> Defines stack size for main thread.
|
||||
// <i> Default: 200
|
||||
#ifndef OS_MAINSTKSIZE
|
||||
#define OS_MAINSTKSIZE 50
|
||||
#define OS_MAINSTKSIZE 200
|
||||
#endif
|
||||
|
||||
// <o>Number of threads with user-provided stack size <0-250>
|
||||
@@ -76,7 +76,7 @@
|
||||
// <i> Defines the combined stack size for threads with user-provided stack size.
|
||||
// <i> Default: 0
|
||||
#ifndef OS_PRIVSTKSIZE
|
||||
#define OS_PRIVSTKSIZE 1024
|
||||
#define OS_PRIVSTKSIZE (8*1024)
|
||||
#endif
|
||||
|
||||
// <q>Check for stack overflow
|
||||
|
||||
Reference in New Issue
Block a user