Skip to content

Commit

Permalink
Queue + EXTI
Browse files Browse the repository at this point in the history
  • Loading branch information
shin21 committed Apr 14, 2014
1 parent 68cdab2 commit ed0bd2f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
30 changes: 28 additions & 2 deletions CORTEX_M4F_STM32F407ZG-SK/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ EXTI_InitTypeDef EXTI_InitStructure;
/* Private function prototypes -----------------------------------------------*/

xQueueHandle MsgQueue;
uint32_t iii = 1;
uint32_t iii = 0;

void USART1_puts(char* s)
{
Expand Down Expand Up @@ -181,11 +181,36 @@ void Task1( void* pvParameters )
iii++;
while( STM_EVAL_PBGetState( BUTTON_USER ) ){
iii++;
STM_EVAL_LEDOn(LED4);
}
}
}


void Task2( void* pvParameters )
{
while( 1 ){
vTaskDelay( 1000 );
itoa(iii, 10);
iii = 0;
}
}

void Task3( void* pvParameters )
{
vTaskDelay( 300000 );
while(1){
itoa(iii, 10);
iii = 100;
itoa(iii, 10);
while(1){}
}
}





void QTask1( void* pvParameters )
{
uint32_t snd = 100;
Expand Down Expand Up @@ -218,7 +243,8 @@ main( void )
MsgQueue = xQueueCreate( 5 , sizeof( uint32_t ) );

xTaskCreate( Task1, (signed char*)"Task1", 128, NULL, tskIDLE_PRIORITY+1, NULL );
xTaskCreate( Task2, (signed char*)"Task1", 128, NULL, tskIDLE_PRIORITY+1, NULL );
// xTaskCreate( Task2, (signed char*)"Task2", 128, NULL, tskIDLE_PRIORITY+2, NULL );
// xTaskCreate( Task3, (signed char*)"Task3", 128, NULL, tskIDLE_PRIORITY+3, NULL );
// xTaskCreate( QTask1, (signed char*)"Task1", 128, NULL, tskIDLE_PRIORITY+1, NULL );
// xTaskCreate( QTask2, (signed char*)"Task2", 128, NULL, tskIDLE_PRIORITY+1, NULL );

Expand Down
14 changes: 6 additions & 8 deletions CORTEX_M4F_STM32F407ZG-SK/stm32f4xx_it.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,14 @@ void EXTI0_IRQHandler(void)
{

if( EXTI_GetITStatus( EXTI_Line0 ) != RESET ){
while(1){
STM_EVAL_LEDToggle( LED4 );
STM_EVAL_LEDToggle( LED4 );

int j,k;
for(j=0;j<10000;j++){
for(k=0;k<1000;k++){}
}

itoa( iii, 10 );
int j,k;
for(j=0;j<10000;j++){
for(k=0;k<1000;k++){}
}

// itoa( iii, 10 );
}
EXTI_ClearITPendingBit( EXTI_Line0 );
}
Expand Down

0 comments on commit ed0bd2f

Please sign in to comment.