remvoe main as thread of cmsis rtx for portability.

Keil & lpcxpresso4 host_cmsis_rtx work well
This commit is contained in:
hathach
2014-03-19 16:06:27 +07:00
parent 582492b02c
commit 96bb6c8968
8 changed files with 56 additions and 44 deletions
+6
View File
@@ -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
+1 -1
View File
@@ -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