/*
  * Start measuring
  */
 void EFM32_CapSenseSlider::start() {
     if(_running == false) {
         CAPLESENSE_Init(true);
         CAPLESENSE_setupCallbacks((cbptr_t)_scanCallback.entry(), (cbptr_t)_channelCallback.entry());
         blockSleepMode(EM2);
         _running = true;
     }
 }
Esempio n. 2
0
/**************************************************************************//**
 * @brief  Main function
 *****************************************************************************/
int main(void)
{
  /* Chip errata */
  CHIP_Init();

  /* If first word of user data page is non-zero, enable eA Profiler trace */
  BSP_TraceProfilerSetup();

  /* Ensure core frequency has been updated */
  SystemCoreClockUpdate();

  /* Initialize capsense */
  CAPLESENSE_Init(true);

  /* Initialize GPIO interrupts */
  gpioSetup();

  /* Start capsense demo. */
  capSenseDemo();

  return 0;
}
Esempio n. 3
0
int main(void)
{
  chip_configs();
  CAPLESENSE_Init(0);
  GPIO_configs();
  UART_init();

  LCD_Init1();
  lcd_str("connecting",1,3);
  //TIMER_config();
  while(GPIO_PinInGet(COM_PORT, Status)==0);
  lcd_str("getting time",1,2);
  time_init();

  lcd_str("did it",1,6);
   choice=1;oc=2;
   LCD_PutCmd ( 0x01 ); /* clear display */
  /* Infinite loop */
  menu_t menu1={1,2};
  menu_t menu2={2,2};
  menu_t menu3={3,2};
  menu_t menu4={4,2};
  menu_t menu5={5,2};

  current=1; //start with menu1


  // flags mor manage the interface in their different menus:
//  unsigned char menu = 1; // 1-> menu1; 2->menu2
//
//  unsigned char menu1 = 0; //defines the main 2 things to do:  1-> start new task; 2-> show statues of current tasks
//  unsigned char menu2 = 0; // 1-> start new task: opens the meu in which it is show  the time the sch calculates and the options for the user
//  unsigned char menu3 = 0; // 2-> show status of current tasks: show the id of the task and the time in which it will be excecuted


char s1[8];

  while (1) {
	 delay(100);

	menuLCD(menu1, menu2,menu3 , menu4, menu5);





//	   if(completed==1)
//	   if(Recieved)
//
//	  				{
//	  					  //getserial(s1);
//	  					  if(strcmp(Buffer,"off")==0)
//	  						  GPIO->P[LED_PORT].DOUTCLR = 1 << LED1;
//
//	  					  else if(strcmp(Buffer,"on")==0)
//	  						  GPIO->P[LED_PORT].DOUTSET = 1 << LED1;
//	  					else if(strcmp(Buffer,"blink")==0)
//	  					{
//							GPIO->P[LED_PORT].DOUTCLR = 1 << LED1;
//							delay(1000);
//							GPIO->P[LED_PORT].DOUTSET = 1 << LED1;
//							delay(1000);
//							GPIO->P[LED_PORT].DOUTCLR = 1 << LED1;
//							delay(1000);
//	  					} else
//	  					sendserial("Solar Ranger says: command wasn't recognized  :( !!! \n");
//	  					sendserial(Buffer);
//	  					completed=0;
//	  				}




  }
}