LCD_Clear( Blue );\r
lLine = 0;\r
}\r
- \r
-if( ulx < 10 )\r
-{\r
- ulTempArray[ ulx++ ] = portGET_RUN_TIME_COUNTER_VALUE();\r
-}\r
-else\r
-{\r
- ulx = 0;\r
-}\r
- \r
+ \r
switch( xReceivedMessage.cMessageID )\r
{\r
case mainMESSAGE_BUTTON_UP : sprintf( cBuffer, "Button up = %d", xReceivedMessage.lMessageValue );\r
case mainMESSAGE_BUTTON_SEL : printf( "\nTask\t Abs Time\t %%Time\n*****************************************\n" );\r
vTaskGetRunTimeStats( ( signed char * ) cBuffer );\r
printf( cBuffer );\r
- sprintf( cBuffer, "Select interrupt!" );\r
+ \r
+ /* The select button passes its\r
+ own string to print out. */\r
+ sprintf( cBuffer, "%s", ( char * ) xReceivedMessage.lMessageValue );\r
break;\r
case mainMESSAGE_STATUS : sprintf( cBuffer, "Task status = %s", ( ( xReceivedMessage.lMessageValue ) ? "PASS" : "FAIL" ) );\r
break;\r
\r
void EXTI9_5_IRQHandler( void )\r
{\r
-const xQueueMessage xMessage = { mainMESSAGE_BUTTON_SEL, 0 };\r
+const xQueueMessage xMessage = { mainMESSAGE_BUTTON_SEL, ( unsigned long ) "Select Interrupt!" };\r
long lHigherPriorityTaskWoken = pdFALSE;\r
\r
xQueueSendFromISR( xLCDQueue, &xMessage, &lHigherPriorityTaskWoken );\r
/* Initialise the LEDs. */\r
vParTestInitialise();\r
\r
- //\r
/* Initialise the joystick inputs. */\r
STM_EVAL_PBInit( BUTTON_UP, BUTTON_MODE_GPIO );\r
STM_EVAL_PBInit( BUTTON_DOWN, BUTTON_MODE_GPIO );\r
TIM_TimeBaseInit( TIM6, &TIM_TimeBaseStructure );\r
\r
/* Only interrupt on overflow events. */\r
- TIM_UpdateRequestConfig( TIM6, TIM_UpdateSource_Regular );\r
+ TIM6->CR1 |= TIM_CR1_URS;\r
+ //TIM6->CR1 &= (uint16_t)~((uint16_t)TIM_CR1_URS);\r
\r
TIM_ITConfig( TIM6, TIM_IT_Update, ENABLE );\r
\r
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0f;\r
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;\r
\r
+ TIM_ClearITPendingBit( TIM6, TIM_IT_Update );\r
NVIC_Init(&NVIC_InitStructure);\r
TIM_Cmd( TIM6, ENABLE );\r
}\r
/*-----------------------------------------------------------*/\r
\r
+unsigned long ulGetRunTimeStatsCounterValue( void )\r
+{\r
+unsigned long ulReturn;\r
+\r
+ TIM6->CR1 &= (uint16_t)(~((uint16_t)TIM_CR1_CEN));\r
+ ulReturn = ( ( ulTIM6_OverflowCount << 16UL ) | ( unsigned long ) TIM6->CNT );\r
+ TIM6->CR1 |= TIM_CR1_CEN;\r
+ \r
+ return ulReturn;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
void TIM6_IRQHandler( void )\r
{\r
- ulTIM6_OverflowCount++;\r
- TIM_ClearITPendingBit( TIM6, TIM_IT_Update );\r
+ if( TIM_GetITStatus( TIM6, TIM_IT_Update) != RESET)\r
+ {\r
+ ulTIM6_OverflowCount++;\r
+ TIM_ClearITPendingBit( TIM6, TIM_IT_Update );\r
+ }\r
}\r
\r
\r