Esempio n. 1
0
 void vLedTask1 (void *pvParameters)
{
	bool led=true;
	
    while(1)
    {
			ChangeLED();
			if ( GPIO_ReadInputDataBit_BOOL(GPIOA,GPIO_Pin_0))
			{
				xTaskCreate(vLedTask2,(signed char *)"LedTask", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY+1 , NULL);	

					if (led)
					{
						GPIO_ResetBits(LED_GPIO,GPIO_Pin_15);
						led=false;
					}	
					else 
					{
						GPIO_SetBits(LED_GPIO,GPIO_Pin_15);
						led=true;
					}
			}
			
			vTaskDelay(PERIOD_LED_TASK);
		}
    vTaskDelete(NULL);	
}
Esempio n. 2
0
/******************************************************************************
* Function Name  : vLedTask
* Description    : Change state led with period 1 c
*******************************************************************************/	
void vLedTask (void *pvParameters)
{
    while(1)
    {
			ChangeLED();
			
			vTaskDelay(PERIOD_LED_TASK);
		}
    vTaskDelete(NULL);	
}
Esempio n. 3
0
void sig_term(int signo)
{
	if(signo == SIGTERM)
	{
		ChangeLED(false);
		printf("Service Stoped\n");
		syslog(LOG_INFO, "program terminated.");
		closelog();
		exit(0);
	}
}
Esempio n. 4
0
void testPinSellected(void)
{
    //功能选择
    if(read_KEY_4==Bit_SET)
    {
        //====================================
        //查询IO,确认是否需要清除EEPROM-------------------IO_1-->Clear All
        if(read_KEY_1==Bit_SET)
        {
            //printf("I'll clear EEPROM U12\r\n");
            //printf("%d:%d\r\n",i,ReadeOneInt_24Cxx(dev,(i&0xFFFC) )  );
            //clearALL_INT_24Cxx(U12);
            //check_clear_24Cxx(U12);
            //printf("Check Clear EEPROM Done\r\n");

        }

        //====================================
        //查询IO,确认是否需要读取EEPROM---------------------IO_2-->Read All
        if(read_KEY_2==Bit_SET)
        {
            //printf("I'll Read EEPROM U12\r\n");
            readALL_INT_24Cxx(U12);
            //printf("Check Clear EEPROM Done\r\n");
        }
        //====================================
        //查询IO,确认是否需要写全EEPROM---------------------IO_3-->Fill All
        if(read_KEY_3==Bit_SET)
        {
            copyrALL_INT_24Cxx(U9,U12);
            //printf("I'llfillALL_TMP102_24Cxx(U12)\r\n");
            fillALL_TMP102_24Cxx(U12);
            //printf("Check Clear EEPROM Done\r\n");
        }


    }

    while(read_KEY_4==Bit_SET)
    {
        ChangeLED();
        Delay_Ms(300);

    }
}