Beispiel #1
0
static portTASK_FUNCTION(MainTask, pvParameters) {
  (void)pvParameters; /* not used */
#if PL_HAS_TSS
  Configure(); /* initialize TSS library */
#endif
  for(;;) {
#if PL_HAS_TSS
    TSS_Task(); /* call TSS library to process touches */
#else
    CheckButton();
#endif
#if PL_APP_FOLLOW_OBSTACLE
    FollowObstacle();
#endif
#if PL_HAS_LED_BLUE
    LEDB_Neg();
#endif
#if PL_HAS_RADIO
    (void)RADIO_Handle();
#endif
#if PL_HAS_EVENTS
    EVNT_HandleEvent(RADIO_AppHandleEvent);
#endif
    StateMachine(FALSE);
    FRTOS1_vTaskDelay(10/portTICK_RATE_MS);
  }
}
Beispiel #2
0
static portTASK_FUNCTION(MainTask, pvParameters) {
  (void)pvParameters; /* not used */
#if PL_USE_TSS
  Configure(); /* initialize TSS library */
#endif
  for(;;) {
#if PL_USE_TSS
    TSS_Task(); /* call TSS library to process touches */
#else
    CheckButton();
#endif
#if PL_HAS_LED_BLUE
    LEDB_Neg();
#endif
    StateMachine(FALSE);
    FRTOS1_vTaskDelay(10/portTICK_RATE_MS);
  }
}
Beispiel #3
0
void main(void)
{
  /* Write your local variable definition here */

  //TT_ptr = &tt;
  
  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */
  //TSS1_Configure();
  
  //RTC_SetCV(65524);
  //RTC_Enable();
  /* For example: for(;;) { } */
 for(;;)
  {
	 //RTC_Disable();
	  TSS_Task();
	  RTC_GetTimeSec(&ttyy);
	  
	 if(Key123_flag_L)
	  {
		  LED1_NegVal();
		  //Key123_flag_L = 0;
	  }
	  else
	  {
		  if(0 != RTC_GetTimeSec(&ttyy))
		  {
			  ttyy = 0;
		  }
		  else
		  {
			  if((0 == (ttyy%5))&&(0 != ttyy)&&(0 == Key123_flag_L))
			  {
				  //enable RTC for Wake up Touch scan
				  //RTC_Enable();
				  
				  // end of enable  RTC
				  
				  LED0_PutVal(0);
				  
				  // before stop, need configuration TSI 
				  //TSI_EnterIntoStopMode();
				  
				  //Cpu_SetStopMode();
				  asm("NOP");
				  asm("NOP");
				  asm("NOP");
				  asm("NOP");
				  asm("NOP");
			  }
		  }
		 
	      
	  }
	  
  }

  /*** Don't write any code pass this line, or it will be deleted during code generation. ***/
  /*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
  #ifdef PEX_RTOS_START
    PEX_RTOS_START();                  /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
  #endif
  /*** End of RTOS startup code.  ***/
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/