Official mbed Real Time Operating System based on the RTX implementation of the CMSIS-RTOS API open standard.
Fork of mbed-rtos by
Revision 55:12e4664cbe28, committed 2014-12-09
- Comitter:
- dmatsumoto
- Date:
- Tue Dec 09 18:40:25 2014 +0000
- Parent:
- 54:f1ef95efa5ad
- Commit message:
- initial test app that shows potential memory usage by mbed-rtos
Changed in this revision
rtx/TARGET_CORTEX_M/rt_CMSIS.c | Show annotated file Show diff for this revision Revisions of this file |
diff -r f1ef95efa5ad -r 12e4664cbe28 rtx/TARGET_CORTEX_M/rt_CMSIS.c --- a/rtx/TARGET_CORTEX_M/rt_CMSIS.c Thu Nov 27 11:45:25 2014 +0000 +++ b/rtx/TARGET_CORTEX_M/rt_CMSIS.c Tue Dec 09 18:40:25 2014 +0000 @@ -63,6 +63,8 @@ #include "cmsis_os.h" +#include "heapsize.hpp" + #if (osFeature_Signals != 16) #error Invalid "osFeature_Signals" value! #endif @@ -350,7 +352,6 @@ extern osMessageQDef_t os_messageQ_def_osTimerMessageQ; extern osMessageQId osMessageQId_osTimerMessageQ; - // ==== Helper Functions ==== /// Convert timeout in millisec to system ticks @@ -475,6 +476,8 @@ osStatus osKernelStart (void) { uint32_t stack[8]; + printf( "in rt_CMSIS.c at beginning of osKernelStart, heap free is: %ld\r\n", heapSize()); + if (__get_IPSR() != 0) return osErrorISR; // Not allowed in ISR switch (__get_CONTROL() & 0x03) { case 0x00: // Privileged Thread mode & MSP @@ -500,6 +503,8 @@ if (os_flags & 1) return osErrorOS; // Privileged Thread mode requested break; } + + return __svcKernelStart(); }