From 77f608eedd62dd706a49fba7ac5b8640666adb6f Mon Sep 17 00:00:00 2001 From: richardbarry Date: Thu, 23 Dec 2010 19:41:05 +0000 Subject: [PATCH] Finish the STM32L152 demo application. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1186 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Demo/Cortex_STM32L152_IAR/FreeRTOSConfig.h | 13 ++------ Demo/Cortex_STM32L152_IAR/main.c | 31 +++++++++---------- .../settings/RTOSDemo.dbgdt | 12 +++---- .../settings/RTOSDemo.dni | 2 +- .../settings/RTOSDemo.wsdt | 12 +++---- 5 files changed, 31 insertions(+), 39 deletions(-) diff --git a/Demo/Cortex_STM32L152_IAR/FreeRTOSConfig.h b/Demo/Cortex_STM32L152_IAR/FreeRTOSConfig.h index 5c9a376f5..a7d59f1ea 100644 --- a/Demo/Cortex_STM32L152_IAR/FreeRTOSConfig.h +++ b/Demo/Cortex_STM32L152_IAR/FreeRTOSConfig.h @@ -109,19 +109,12 @@ to exclude the API function. */ #endif #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 -//#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 -#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 15 +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 /* The lowest priority. */ -//#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) +#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) /* Priority 5, or 160 as only the top three bits are implemented. */ -//#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) - -/* The lowest priority. */ -#define configKERNEL_INTERRUPT_PRIORITY 255 -/* Priority 5, or 160 as only the top three bits are implemented. */ -#define configMAX_SYSCALL_INTERRUPT_PRIORITY 255 - +#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) /* Prevent the following definitions being included when FreeRTOSConfig.h is included from an asm file. */ diff --git a/Demo/Cortex_STM32L152_IAR/main.c b/Demo/Cortex_STM32L152_IAR/main.c index a47d0ce28..8e7def36e 100644 --- a/Demo/Cortex_STM32L152_IAR/main.c +++ b/Demo/Cortex_STM32L152_IAR/main.c @@ -58,9 +58,9 @@ * * main() creates all the demo application tasks, then starts the scheduler. * A lot of the created tasks are from the pool of "standard demo" tasks. The - * web documentation provides more details of the standard demo application - * tasks, which provide no particular functionality but do provide a good - * example of how to use the FreeRTOS API. + * web documentation provides more details of the standard demo tasks, which + * provide no particular functionality but do provide good examples of how to + * use the FreeRTOS API. * * In addition to the standard demo tasks, the following tasks, interrupts and * tests are defined and/or created within this file: @@ -73,7 +73,7 @@ * the actual LCD output. This mechanism also allows interrupts to, in effect, * write to the LCD by sending messages to the LCD task. * - * The LCD task is also a demonstration of a controller task design pattern. + * The LCD task is also a demonstration of a 'controller' task design pattern. * Some tasks do not actually send a string to the LCD task directly, but * instead send a command that is interpreted by the LCD task. In a normal * application these commands can be control values or set points, in this @@ -145,18 +145,16 @@ to send messages from tasks and interrupts the the LCD task. */ #define mainQUEUE_LENGTH ( 5 ) -/* Codes sent within message to the LCD task so the LCD task can interrupt +/* Codes sent within messages to the LCD task so the LCD task can interpret exactly what the message it just received was. These are sent in the cMessageID member of the message structure (defined below). */ #define mainMESSAGE_BUTTON_UP ( 1 ) #define mainMESSAGE_BUTTON_SEL ( 2 ) #define mainMESSAGE_STATUS ( 3 ) -/* When cMessageID member of the message sent to the LCD task is +/* When the cMessageID member of the message sent to the LCD task is mainMESSAGE_STATUS then these definitions are sent in the lMessageValue member -of the same message to indicate what the status actually is. The value 1 is not -used as this is globally defined as pdPASS, and indicates that no errors have -been reported (the system is running as expected). */ +of the same message and indicate what the status actually is. */ #define mainERROR_DYNAMIC_TASKS ( pdPASS + 1 ) #define mainERROR_COM_TEST ( pdPASS + 2 ) #define mainERROR_GEN_QUEUE_TEST ( pdPASS + 3 ) @@ -240,7 +238,7 @@ void main( void ) /* Create the LCD and button poll tasks, as described at the top of this file. */ xTaskCreate( prvLCDTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL ); - xTaskCreate( vButtonPollTask, ( signed char * ) "Temp", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); + xTaskCreate( vButtonPollTask, ( signed char * ) "ButPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); /* Create a subset of the standard demo tasks. */ vStartDynamicPriorityTasks(); @@ -284,13 +282,14 @@ static char cBuffer[ 512 ]; for( ;; ) { - /* Wait for a message to be received. This will wait indefinitely if - INCLUDE_vTaskSuspend is set to 1 in FreeRTOSConfig.h, therefore there - is no need to check the function return value. */ + /* Wait for a message to be received. Using portMAX_DELAY as the block + time will result in an indefinite wait provided INCLUDE_vTaskSuspend is + set to 1 in FreeRTOSConfig.h, therefore there is no need to check the + function return value and the function will only return when a value + has been received. */ xQueueReceive( xLCDQueue, &xReceivedMessage, portMAX_DELAY ); - /* Clear the LCD if the last LCD message was output to the last - available line on the LCD. */ + /* Clear the LCD if no room remains for any more text output. */ if( lLine > Line9 ) { LCD_Clear( Blue ); @@ -515,7 +514,7 @@ NVIC_InitTypeDef NVIC_InitStructure; automatically at the appropriate time. */ /* TIM6 clock enable */ - RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM6, ENABLE); + RCC_APB1PeriphClockCmd( RCC_APB1Periph_TIM6, ENABLE ); /* The 32MHz clock divided by 5000 should tick (very) approximately every 150uS and overflow a 16bit timer (very) approximately every 10 seconds. */ diff --git a/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dbgdt b/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dbgdt index be0489899..febe4e617 100644 --- a/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dbgdt +++ b/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dbgdt @@ -19,7 +19,7 @@ - 295272727 + 332272727 @@ -36,7 +36,7 @@ - + TabID-15530-21362 @@ -44,24 +44,24 @@ Workspace - RTOSDemoRTOSDemo/FreeRTOS_SourceRTOSDemo/FreeRTOS_Source/Portable + RTOSDemoRTOSDemo/FreeRTOS_SourceRTOSDemo/FreeRTOS_Source/PortableRTOSDemo/Standard_Demo_Code - 0TabID-10464-23570TasksTASKVIEW0TabID-31438-23586QueuesQUEUEVIEW0TabID-15541-875Terminal I/OTerminalIO0 + 0TabID-10464-23570TasksTASKVIEW0TabID-31438-23586QueuesQUEUEVIEW0TabID-15541-875Terminal I/OTerminalIO0 - TextEditor$WS_DIR$\system_and_ST_code\STM32L152_EVAL\stm32l152_eval.c03111162611626TextEditor$WS_DIR$\system_and_ST_code\STM32L1xx_StdPeriph_Driver\src\stm32l1xx_gpio.c020360706070TextEditor$WS_DIR$\serial.c0000TextEditor$WS_DIR$\FreeRTOSConfig.h05942504280TextEditor$WS_DIR$\main.c021510723107234TextEditor$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\port.c0160695069500100000010000001 + TextEditor$WS_DIR$\main.c02081072310723TextEditor$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\port.c016169716971TextEditor$WS_DIR$\..\..\Source\queue.c0107536766367662TextEditor$WS_DIR$\..\Common\Minimal\dynamic.c03591499114991TextEditor$WS_DIR$\FreeRTOSConfig.h09955065506TextEditor$WS_DIR$\serial.c019180058022TextEditor$WS_DIR$\..\Common\Minimal\comtest.c0150789479030100000010000001 - iaridepm.enu1debuggergui.enu1armjlink.enu1-2-2465369-2-2200200119048203666220833475560-2-2465435-2-2200200119048203666260119475560-2-23381682-2-216843401002381346232119048203666336-24491682-233616841131002381115071119048203666 + iaridepm.enu1debuggergui.enu1armjlink.enu1-2-2659406-2-2200200119048203666242857673116-2-2659334-2-2200200119048203666200000673116-2-21721682-2-216841741002381177189119048203666170-22551682-2170168485100238186558119048203666 diff --git a/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dni b/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dni index f310663e6..f9ea5cda8 100644 --- a/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dni +++ b/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.dni @@ -1,5 +1,5 @@ [DebugChecksum] -Checksum=2056793833 +Checksum=1889325515 [DisAssemblyWindow] NumStates=_ 1 State 1=_ 1 diff --git a/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.wsdt b/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.wsdt index 097c38fb6..f0f8a66c3 100644 --- a/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.wsdt +++ b/Demo/Cortex_STM32L152_IAR/settings/RTOSDemo.wsdt @@ -12,12 +12,12 @@ - 348272727 + 364272727 20121632481201622 - + TabID-27630-4718 @@ -25,24 +25,24 @@ Workspace - RTOSDemoRTOSDemo/FreeRTOS_SourceRTOSDemo/FreeRTOS_Source/PortableRTOSDemo/Standard_Demo_CodeRTOSDemo/System_and_ST_CodeRTOSDemo/System_and_ST_Code/Peripheral_LibraryRTOSDemo/System_and_ST_Code/Peripheral_Library/stm32l1xx_pwr.cRTOSDemo/main.c + RTOSDemo - 0TabID-10002-7709BuildBuildTabID-18437-21512Debug LogDebug-Log0 + 0TabID-10002-7709BuildBuildTabID-18437-21512Debug LogDebug-Log0 - TextEditor$WS_DIR$\system_and_ST_code\STM32L152_EVAL\stm32l152_eval.c03111162611626TextEditor$WS_DIR$\system_and_ST_code\STM32L1xx_StdPeriph_Driver\src\stm32l1xx_gpio.c020360706070TextEditor$WS_DIR$\serial.c0000TextEditor$WS_DIR$\FreeRTOSConfig.h05942504280TextEditor$WS_DIR$\main.c021510723107234TextEditor$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\port.c0160695069500100000010000001 + TextEditor$WS_DIR$\main.c0453100310000100000010000001 - iaridepm.enu1-2-2740438-2-2200200119048203666261905755601-2-21981682-2-216842001002381203666119048203666 + iaridepm.enu1-2-2740438-2-2200200119048203666261905755601-2-21981682-2-216842001002381203666119048203666 -- 2.39.2