OBJCOPY=arm-none-eabi-objcopy\r
LDSCRIPT=standalone.ld\r
\r
-LINKER_FLAGS=-nostartfiles -Xlinker -oRTOSDemo.axf -Xlinker -M -Xlinker -Map=rtosdemo.map\r
+# should use --gc-sections but the debugger does not seem to be able to cope with the option.\r
+LINKER_FLAGS=-nostartfiles -Xlinker -oRTOSDemo.axf -Xlinker -M -Xlinker -Map=rtosdemo.map -Xlinker --no-gc-sections\r
\r
DEBUG=-g\r
OPTIM=-O0\r
CFLAGS=$(DEBUG) -I . -I $(RTOS_SOURCE_DIR)/include -I $(RTOS_SOURCE_DIR)/portable/GCC/ARM_CM3 \\r
-I $(DEMO_INCLUDE_DIR) -D GCC_ARMCM3_LM3S102 -D inline= -mthumb -mcpu=cortex-m3 $(OPTIM) -T$(LDSCRIPT) \\r
-D PACK_STRUCT_END=__attribute\(\(packed\)\) -D ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\) -D sprintf=usprintf -D snprintf=usnprintf -D printf=uipprintf \\r
- -I $(UIP_COMMON_DIR) -I ./webserver -ffunction-sections -fdata-sections -Wl,--no-gc-sections -I $(LUMINARY_DRIVER_DIR)\r
+ -I $(UIP_COMMON_DIR) -I ./webserver -ffunction-sections -fdata-sections -I $(LUMINARY_DRIVER_DIR)\r
\r
SOURCE= main.c \\r
timertest.c \\r
$(DEMO_COMMON_DIR)/semtest.c \\r
$(DEMO_COMMON_DIR)/GenQTest.c \\r
$(DEMO_COMMON_DIR)/QPeek.c \\r
+ $(DEMO_COMMON_DIR)/recmutex.c \\r
./webserver/uIP_Task.c \\r
./webserver/emac.c \\r
./webserver/httpd.c \\r
#include "bitmap.h"\r
#include "GenQTest.h"\r
#include "QPeek.h"\r
+#include "recmutex.h"\r
\r
/* Hardware library includes. */\r
#include "hw_memmap.h"\r
vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );\r
vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
vStartQueuePeekTasks();\r
+ vStartRecursiveMutexTasks();\r
\r
/* Start the tasks defined within this file/specific to this demo. */\r
xTaskCreate( vOLEDTask, ( signed portCHAR * ) "OLED", mainOLED_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
else if( xAreIntegerMathsTaskStillRunning() != pdTRUE )\r
{\r
xMessage.pcMessage = "ERROR IN MATH";\r
+ }\r
+ else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
+ {\r
+ xMessage.pcMessage = "ERROR IN REC MUTEX";\r
}\r
else if( ulIdleError != pdFALSE )\r
{\r
unsigned portLONG ulY, ulMaxY;\r
static portCHAR cMessage[ mainMAX_MSG_LEN ];\r
extern unsigned portLONG ulMaxJitter;\r
+unsigned portBASE_TYPE uxUnusedStackOnEntry, uxUnusedStackNow;\r
\r
/* Functions to access the OLED. The one used depends on the dev kit\r
being used. */\r
void ( *vOLEDImageDraw )( const unsigned portCHAR *, unsigned portLONG, unsigned portLONG, unsigned portLONG, unsigned portLONG );\r
void ( *vOLEDClear )( void );\r
\r
+ /* Just for demo purposes. */\r
+ uxUnusedStackOnEntry = uxTaskGetStackHighWaterMark( NULL );\r
+\r
/* Map the OLED access functions to the driver functions that are appropriate\r
for the evaluation kit being used. */ \r
switch( HWREG( SYSCTL_DID1 ) & SYSCTL_DID1_PRTNO_MASK )\r
vOLEDStringDraw( " POWERED BY FreeRTOS", 0, 0, mainFULL_SCALE );\r
vOLEDImageDraw( pucImage, 0, mainCHARACTER_HEIGHT + 1, bmpBITMAP_WIDTH, bmpBITMAP_HEIGHT );\r
\r
+ uxUnusedStackNow = uxTaskGetStackHighWaterMark( NULL );\r
+ \r
for( ;; )\r
{\r
/* Wait for a message to arrive that requires displaying. */\r
" .align 2 \n" \r
"ulIdleErrorConst: .word ulIdleError" );\r
}\r
+/*-----------------------------------------------------------*/\r
\r
-\r
+void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed portCHAR *pcTaskName )\r
+{\r
+ for( ;; );\r
+}\r
\r
extern int main(void);\r
extern void xPortPendSVHandler(void);\r
extern void xPortSysTickHandler(void);\r
+extern void vPortSVCHandler( void );\r
extern void Timer0IntHandler( void );\r
extern void vEMAC_ISR(void);\r
\r
0, // Reserved\r
0, // Reserved\r
0, // Reserved\r
- IntDefaultHandler, // SVCall handler\r
+ vPortSVCHandler, // SVCall handler\r
IntDefaultHandler, // Debug monitor handler\r
0, // Reserved\r
xPortPendSVHandler, // The PendSV handler\r