移植平台STM32F103RB单板
移植参考文献:http://wenku.baidu.com/link?url=pSwvtjQSfc5MiDcgPx8g0llbXUEV0GWH_QP7IMxIDdYqGPtSkSA40KiDprZZxEW4zlJkckZdESCPtYU9peKOLc-XGfYoNgygAgLd5MR1Wh7
PA8口LED可以正常闪烁
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
//unsigned short usBit;
vTaskSuspendAll();
{
// if( uxLED < partstMAX_OUTPUT_LED )
// {
if (uxLED)
{
GPIO_SetBits(GPIOA,GPIO_Pin_8);
//GPIO_ResetBits(GPIOD,GPIO_Pin_2);
}
else
{
//GPIO_SetBits(GPIOD,GPIO_Pin_2);
GPIO_ResetBits(GPIOA,GPIO_Pin_8);
}
// usBit = partstFIRST_LED << uxLED;
// if( usOutputValue & usBit )
// {
// usOutputValue &= ~usBit;
// }
// else
// {
// usOutputValue |= usBit;
// }
// GPIO_Write( GPIOC, usOutputValue );
// }
}
xTaskResumeAll();
}
static void vLEDFlashTask( void *pvParameters )
{
xLEDParameters *pxParameters;
/* Queue a message for printing to say the task has started. */
//vPrintDisplayMessage( &pcTaskStartMsg );
pxParameters = ( xLEDParameters * ) pvParameters;
for(;;)
{
/* Delay for half the flash period then turn the LED on. */
vTaskDelay( pxParameters->xFlashRate / ( TickType_t ) 2 );
vParTestToggleLED( pxParameters->uxLED );
/* Delay for half the flash period then turn the LED off. */
vTaskDelay( pxParameters->xFlashRate / ( TickType_t ) 2 );
vParTestToggleLED( 1 );
}
}
代码下载链接
http://pan.baidu.com/s/1kTEBKeb