]> git.sur5r.net Git - freertos/commitdiff
Add SVC handler to startup and recursive mutexes to the list of test tasks.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sun, 23 Mar 2008 16:58:34 +0000 (16:58 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sun, 23 Mar 2008 16:58:34 +0000 (16:58 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@259 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/Makefile
Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/main.c
Demo/CORTEX_LM3Sxxxx_Eclipse/RTOSDemo/startup.c

index f7a238947a2381253904cfd884c88a7eb4f66759..0279ba8545d9c8efd65bde8e1f515198df1894cb 100644 (file)
@@ -39,7 +39,8 @@ CC=arm-none-eabi-gcc
 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
@@ -48,7 +49,7 @@ OPTIM=-O0
 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
@@ -64,6 +65,7 @@ SOURCE=       main.c \
                $(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
index cdbcb01cce414eb75837458e83217e5a425f65c0..7622caca2cf93f375888fb1f3f82ca07d9296a18 100644 (file)
@@ -97,6 +97,7 @@
 #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
@@ -214,6 +215,7 @@ int main( void )
     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
@@ -303,6 +305,10 @@ static unsigned portLONG ulTicksSinceLastDisplay = 0;
            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
@@ -321,6 +327,7 @@ xOLEDMessage xMessage;
 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
@@ -329,6 +336,9 @@ void ( *vOLEDStringDraw )( const portCHAR *, unsigned portLONG, unsigned portLON
 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
@@ -356,6 +366,8 @@ void ( *vOLEDClear )( void );
        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
@@ -437,6 +449,10 @@ void vApplicationIdleHook( void )
                                        "       .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
index 4593d3f43053c4a0443edc7e96bb67387836a462..c01ae4d88338f937efa5db3761aafec891ec131e 100644 (file)
@@ -43,6 +43,7 @@ static void IntDefaultHandler(void);
 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
@@ -78,7 +79,7 @@ void (* const g_pfnVectors[])(void) =
     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