예제 #1
0
void APP_HandleEvent(byte event) {
  switch(event) {
    case EVNT1_INIT:
      LED1_On(); WAIT1_Waitms(200); 
      LED2_On(); WAIT1_Waitms(200); 
      LED3_On(); WAIT1_Waitms(200); 
      LED4_On(); WAIT1_Waitms(200);
      LED1_Off(); LED2_Off(); LED3_Off(); LED4_Off();
      break;
    case EVNT1_SW1_PRESSED:
      LED1_On(); WAIT1_Waitms(200); LED1_Off();
      break;
    case EVNT1_SW2_PRESSED:
      LED2_On(); WAIT1_Waitms(200); LED2_Off();
      break;
    case EVNT1_SW3_PRESSED:
      LED3_On(); WAIT1_Waitms(200); LED3_Off();
      break;
    case EVNT1_SW4_PRESSED:
      LED4_On(); WAIT1_Waitms(200); LED4_Off();
      break;
    case EVNT1_SW1_LONG_PRESSED:
      LED1_On(); WAIT1_Waitms(500); LED1_Off();
      break;
    case EVNT1_SW2_LONG_PRESSED:
      LED2_On(); WAIT1_Waitms(500); LED2_Off();
      break;
    case EVNT1_SW3_LONG_PRESSED:
      LED3_On(); WAIT1_Waitms(500); LED3_Off();
      break;
    case EVNT1_SW4_LONG_PRESSED:
      LED4_On(); WAIT1_Waitms(500); LED4_Off();
      break;
  } /* switch */
}
예제 #2
0
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */

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

  /* Write your code here */
  LED1_On();
  WAIT1_Waitms(100);
  LED1_Off();

  LED2_On();
  WAIT1_Waitms(100);
  LED2_Off();

  LED3_On();
  WAIT1_Waitms(100);
  LED3_Off();

  CDC_Run();

  /*** 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!!! ***/
예제 #3
0
void APP_Start(void) {
  PL_Init(); /* platform initialization */
  //TEST_Test();
  EVNT_SetEvent(EVNT_INIT); /* set initial event */
#if PL_HAS_RTOS
  if (FRTOS1_xTaskCreate(AppTask, (signed portCHAR *)"App", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL) != pdPASS) {
    for(;;){} /* error */
  }
  RTOS_Run();
#else
  APP_Loop();
#endif
#if 0
  for(;;) {
#if PL_HAS_MEALY
    MEALY_Step();
#else
    LED1_On();
    WAIT1_Waitms(300);
    LED1_Off();
    LED2_On();
    WAIT1_Waitms(300);
    LED2_Off();
    LED3_On();
    WAIT1_Waitms(300);
    LED3_Off();
#endif
  }
#endif
  /* just in case we leave the main application loop */
  PL_Deinit();
}
예제 #4
0
void APP_Run(void) {
  LED1_On();
  LED1_Off();
  LED2_On();
  LED2_Off();
  LED3_On();
  LED3_Off();
#if PL_HAS_SHELL
  SHELL_Init();
#endif
#if PL_HAS_ESC
  ESC_Init();
#endif
  if (FRTOS1_xTaskCreate(
      AppTask,  /* pointer to the task */
      "Main", /* task name for kernel awareness debugging */
      configMINIMAL_STACK_SIZE, /* task stack size */
      (void*)NULL, /* optional task startup argument */
      tskIDLE_PRIORITY,  /* initial priority */
      (xTaskHandle*)NULL /* optional task handle to create */
    ) != pdPASS)
  {
    for(;;){} /* error! probably out of memory */
  }
  FRTOS1_vTaskStartScheduler();
  for(;;) {}
}
예제 #5
0
/*!
 * \brief LED test routine.
 * This routine tests if:
 * - we can turn the LEDs properly on and off
 * - if we can negate them
 * - if we can set an LED value
 * - if we can get the LED value
 * If the test fails, the program will hanging in an endless loop
 */
void LED_Test(void) {
  bool isOn = TRUE;

  LED1_On();
  LED2_On();
  LED3_On();

  LED1_Off();
  LED2_Off();
  LED3_Off();

  LED1_Neg();
  LED2_Neg();
  LED3_Neg();

  LED1_On();
/*
 if (!LED1_Get()) {
   LED3_Off();
  }

  LED1_Off();
  if (LED1_Get()) {
    for(;;){}; /* error
  }
  LED1_Put(isOn);
  if (!LED1_Get()) {
    for(;;){}; /* error
  }
  */
}
예제 #6
0
파일: RNet_App.c 프로젝트: c-kel/Assorted
static portTASK_FUNCTION(RNetTask, pvParameters) {
  uint32_t cntr;
  uint8_t msgCntr;

  (void)pvParameters; /* not used */
  if (RAPP_SetThisNodeAddr(RNWK_ADDR_BROADCAST)!=ERR_OK) { /* set a default address */
    for(;;); /* "ERR: Failed setting node address" */
  }
  cntr = 0; /* initialize LED counter */
  msgCntr = 0; /* initialize message counter */
  appState = RNETA_INITIAL; /* initialize state machine state */
  for(;;) {
    Process(); /* process state machine */
    cntr++;
    if (cntr==100) { /* with an RTOS 10 ms/100 Hz tick rate, this is every second */
      LED3_On(); /* blink blue LED for 20 ms */
      RAPP_SendPayloadDataBlock(&msgCntr, sizeof(msgCntr), RAPP_MSG_TYPE_PING, RNWK_ADDR_BROADCAST, RPHY_PACKET_FLAGS_NONE);
      msgCntr++;
      cntr = 0;
      FRTOS1_vTaskDelay(20/portTICK_RATE_MS);
      LED3_Off(); /* blink blue LED */
    }
    FRTOS1_vTaskDelay(10/portTICK_RATE_MS);
  } /* for */
}
예제 #7
0
파일: LED3.c 프로젝트: ydovgalyuk/projects
/*
** ===================================================================
**     Method      :  LED3_SetRatio16 (component LEDbit)
**     Description :
**         Method to specify the duty cycle. If using a PWM pin, this
**         means the duty cycle is set. For On/off pins, values smaller
**         0x7FFF means off, while values greater means on.
**     Parameters  :
**         NAME            - DESCRIPTION
**         ratio           - Ratio value, where 0 means 'off' and
**                           0xffff means 'on'
**     Returns     : Nothing
** ===================================================================
*/
void LED3_SetRatio16(word ratio)
{
  /* on/off LED: binary on or off */
  if (ratio<(0xffff/2)) {
    LED3_Off();
  } else {
    LED3_On();
  }
}
예제 #8
0
파일: main.c 프로젝트: Athuli7/Microchip
/****************************************************************************
  Function:
    void SetLEDs(BYTE setting)

  Summary:
    change the LED settings of the boards

  Description:
    change the LED settings of the boards

  Precondition:
    None

  Parameters:
    BYTE setting - bitmap for desired LED setting (1 = On, 0 = Off)
        bit 0 = LED 0
        bit 1 = LED 1
        bit 2 = LED 2
        ...
        bit 7 = LED 7

  Return Values:
    None

  Remarks:
    None
  ***************************************************************************/
static void SetLEDs(BYTE setting)
{
    if((setting & 0x01) == 0x01) { LED0_On(); } else { LED0_Off(); }
    if((setting & 0x02) == 0x02) { LED1_On(); } else { LED1_Off(); }
    if((setting & 0x04) == 0x04) { LED2_On(); } else { LED2_Off(); }
    if((setting & 0x08) == 0x08) { LED3_On(); } else { LED3_Off(); }
    if((setting & 0x10) == 0x10) { LED4_On(); } else { LED4_Off(); }
    if((setting & 0x20) == 0x20) { LED5_On(); } else { LED5_Off(); }
    if((setting & 0x40) == 0x40) { LED6_On(); } else { LED6_Off(); }
    if((setting & 0x80) == 0x80) { LED7_On(); } else { LED7_Off(); }
}
예제 #9
0
/*lint -save  -e970 Disable MISRA rule (6.3) checking. */
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
  /* Write your local variable definition here */
  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/

#if PL_HAS_SD_CARD
  /* SD card detection: PTE6 with pull-down! */
  PORT_PDD_SetPinPullSelect(PORTE_BASE_PTR, 6, PORT_PDD_PULL_DOWN);
  PORT_PDD_SetPinPullEnable(PORTE_BASE_PTR, 6, PORT_PDD_PULL_ENABLE);
#endif
#if PL_HAS_KEYS
  /* SW3: PTA4 */
  PORT_PDD_SetPinPullSelect(PORTA_BASE_PTR, 4, PORT_PDD_PULL_UP);
  PORT_PDD_SetPinPullEnable(PORTA_BASE_PTR, 4, PORT_PDD_PULL_ENABLE);
  /* SW2: PTC6 */
  PORT_PDD_SetPinPullSelect(PORTC_BASE_PTR, 6, PORT_PDD_PULL_UP);
  PORT_PDD_SetPinPullEnable(PORTC_BASE_PTR, 6, PORT_PDD_PULL_ENABLE);
#endif
#if PL_HAS_BLUETOOTH
  /* pull up Rx pin (PTC14) for Bluetooth module */
  PORT_PDD_SetPinPullSelect(PORTC_BASE_PTR, 14, PORT_PDD_PULL_UP);
  PORT_PDD_SetPinPullEnable(PORTC_BASE_PTR, 14, PORT_PDD_PULL_ENABLE);
#endif
  LED1_On();
  WAIT1_Waitms(50);
  LED1_Off();
  WAIT1_Waitms(50);
  LED2_On();
  WAIT1_Waitms(50);
  LED2_Off();
  WAIT1_Waitms(50);
  LED3_On();
  WAIT1_Waitms(50);
  LED3_Off();
  WAIT1_Waitms(50);
  APP_Start();

  /*** 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!!! ***/
예제 #10
0
void USART1_IRQHandler(void)
{    
  if (USART_GetITStatus(USART1, USART_IT_RXNE) != RESET) { //==SET
    uart1_data = USART_ReceiveData(USART1);      
  
  if(i == '0'){
    if (uart1_data =='a') i = uart1_data;
    else if(uart1_data =='d') i = uart1_data;
    else i = '0';
  }
  else if(i == 'a'){
    i = (uart1_data =='b') ? uart1_data : '0';
  }
  else if(i == 'b'){
    i = (uart1_data =='c') ? uart1_data : '0';
  }
  else if(i == 'c'){
    if (uart1_data =='3') i = uart1_data;
    else if(uart1_data =='4') i = uart1_data;
    else i = '0';
  }
  else if(i == '3'){
    if(uart1_data =='o') LED3_On();
    else if(uart1_data =='f') LED3_Off();
    i = '0';
  }
  else if(i == '4'){
    if(uart1_data =='o') LED4_On();
    else if(uart1_data =='f') LED4_Off();
    i = '0';
  }
  else if(i == 'd'){
    i = (uart1_data =='e') ? uart1_data : '0';
  }
  else if(i == 'e'){
    i = (uart1_data =='f') ? uart1_data : '0';
  }
  else if(i == 'f'){
    if(uart1_data =='3') LED3_Toggle();
    else if(uart1_data =='4') LED4_Toggle();
    i = '0';
  }

  USART_SendData(USART1, i);
}

}
예제 #11
0
void APP_Run(void) {
#if configUSE_TRACE_HOOKS
  if (RTOSTRC1_uiTraceStart()==0) {
    for(;;){} /* error starting trace recorder. Not setup for enough queues/tasks/etc? */
  }
#endif

#if PL_HAS_SD_CARD
  /* SD card detection: PTB16 with pull-down! */
  PORT_PDD_SetPinPullSelect(PORTB_BASE_PTR, 16, PORT_PDD_PULL_DOWN);
  PORT_PDD_SetPinPullEnable(PORTB_BASE_PTR, 16, PORT_PDD_PULL_ENABLE);
#endif
#if PL_HAS_PUSH_BUTTONS
  /* SW2: PTC1 */
  PORT_PDD_SetPinPullSelect(PORTC_BASE_PTR, 1, PORT_PDD_PULL_UP);
  PORT_PDD_SetPinPullEnable(PORTC_BASE_PTR, 1, PORT_PDD_PULL_ENABLE);
  /* SW3: PTB17 */
  PORT_PDD_SetPinPullSelect(PORTB_BASE_PTR, 17, PORT_PDD_PULL_UP);
  PORT_PDD_SetPinPullEnable(PORTB_BASE_PTR, 17, PORT_PDD_PULL_ENABLE);
#endif

  LED1_On();
  LED1_Off();
  LED2_On();
  LED2_Off();
  LED3_On();
  LED3_Off();
#if PL_HAS_SHELL
  SHELL_Init();
#endif
#if PL_HAS_ESC
  ESC_Init();
#endif
  if (FRTOS1_xTaskCreate(
      AppTask,  /* pointer to the task */
      "Main", /* task name for kernel awareness debugging */
      configMINIMAL_STACK_SIZE, /* task stack size */
      (void*)NULL, /* optional task startup argument */
      tskIDLE_PRIORITY,  /* initial priority */
      (xTaskHandle*)NULL /* optional task handle to create */
    ) != pdPASS)
  {
    for(;;){} /* error! probably out of memory */
  }
  FRTOS1_vTaskStartScheduler();
  for(;;) {}
}
예제 #12
0
void APP_Run(void) {
  uint8_t res=ERR_OK;
  uint8_t xyz[3];
  
  LED1_On();
  LED2_On();
  LED3_On();
  res = MMA8451_Init();
  while (res==ERR_OK) {
    res = MMA8451_GetRawXYZ(&xyz[0]);
    LED1_Put(xyz[0]>50);
    LED2_Put(xyz[1]>50);
    LED3_Put(xyz[2]>50);
  }
  LED1_Off();
  LED2_Off();
  LED3_Off();
}
예제 #13
0
void LED_Test(void) {
#if PL_CONFIG_NOF_LED>=1
	LED1_On();
	WAIT1_Waitms(500);
	LED1_Off();
#endif
#if PL_CONFIG_NOF_LED>=2
	LED2_On();
	WAIT1_Waitms(500);
	LED2_Off();
#endif
#if PL_CONFIG_NOF_LED>=3
	LED3_On();
	WAIT1_Waitms(500);
	LED3_Off();
#endif
#if PL_CONFIG_NOF_LED>=4
	#error "only 3 LED ;)"
#endif
}
예제 #14
0
static void TestFlash(void) {
    //IFsh1_Init();
	LED3_On();
	WAIT1_Waitms(500);
#if 1
	if (IFsh1_EraseSector(FLASH_ADDR)!=ERR_OK) {
		  for(;;) {
			  LED1_Neg();
			  WAIT1_Waitms(50);
		  }
	}
	if (IFsh1_SetBlockFlash(&data[0], FLASH_ADDR, sizeof(data))!=ERR_OK) {
		  for(;;) {
			  LED2_Neg();
			  WAIT1_Waitms(100);
		  }
	}
#endif
	LED3_Off();
}
예제 #15
0
void APP_HandleEvent(byte event) {
  switch(event) {
    case EVNT1_INIT:
      LED1_On(); LED2_On(); LED3_On(); LED4_On();
      WAIT1_Waitms(500);
      LED1_Off(); LED2_Off(); LED3_Off(); LED4_Off();
      break;
    case EVNT1_BTN1_PRESSED:
#if HAS_SOUND
      RTOS_StartSounder(300);
#endif
      LED4_Neg();
      SHELL_SendStr("SW1 pressed!\r\n");
      break;
    case EVNT1_BTN2_PRESSED:
#if HAS_SOUND
      RTOS_StartSounder(500);
#endif
      LED5_Neg();
      SHELL_SendStr("SW2 pressed!\r\n");
      break;
    case EVNT1_BTN3_PRESSED:
#if HAS_SOUND
      RTOS_StartSounder(700);
#endif
      LED7_Neg();
      SHELL_SendStr("SW3 pressed!\r\n");
      break;
    case EVNT1_BTN4_PRESSED:
#if HAS_SOUND
      RTOS_StartSounder(900);
#endif
      LED8_Neg();
      SHELL_SendStr("SW4 pressed!\r\n");
      break;
    default:
      break;
  } /* switch */
}
예제 #16
0
void APP_Run(void) {
  int16_t x,y,z;
  uint8_t res;
  #define ACCEL_VAL  2000

  res = FX1_Enable(); /* enable accelerometer (just in case) */
  if (res!=ERR_OK) {
    Err();
  }
  if (FAT1_Init()!=ERR_OK) {
    Err();
  }
  if (FAT1_mount(0, &fileSystemObject) != FR_OK) { /* mount file system */
    Err();
  }
  for(;;) {
    //LED1_Neg();
    x = FX1_GetX();
    y = FX1_GetY();
    z = FX1_GetZ();
    if (x>ACCEL_VAL || x<-ACCEL_VAL) {
      LED1_On();
      LED2_Off();
      LED3_Off();
    } else if (y>ACCEL_VAL || y<-ACCEL_VAL) {
      LED1_Off();
      LED2_On();
      LED3_Off();
    } else if (z>ACCEL_VAL || z<-ACCEL_VAL) {
      LED1_Off();
      LED2_Off();
      LED3_On();
    }
    LogToFile(x, y, z);
    WAIT1_Waitms(1000);
  }
}
예제 #17
0
static portTASK_FUNCTION(TaskMain, pvParameters ) {
  byte i;
#if PL_HAS_HW_LED
  byte cntr;
#endif
  
	/* The parameters are not used. */
	(void)pvParameters;
#if PL_HAS_WATCHDOG
	WDOG_Clear();
#endif
#if PL_HAS_HW_TOUCHSCREEN
  TouchScreen_CheckTouchScreenCalibrationData();
#endif
  BUZ_Init();
#if PL_HAS_UI
  APP_Init();
#endif
#if PL_HAS_HW_LED
  cntr = 0;
  LED3_On(); LED4_Off();
#endif
	for(;;) {
  #if PL_HAS_HW_TOUCHSCREEN
    TCHS1_Scan();
  #endif
  #if PL_POLL_KEYS2    
    KEY2_ScanKeys(); /* poll keys */
  #endif
    i = 10; /* to avoid stalling */
    while (EVNT1_EventsPending() && i>0) {
      EVNT1_HandleEvent();
      i--;
    }
  #if PL_HAS_HW_LED
    cntr++;
    if (cntr == 10) {  /* change LED's */
      LED3_Neg();
      LED4_Neg();
      cntr = 0;
    }
  #endif
#if PL_HAS_AUTO_DEMO
  #if PL_HAS_FONT_DEMO
    FRTOS1_vTaskDelay((2*1000)/portTICK_RATE_MS);
    APP_SetApplicationMode(APP_MODE_FONT_DEMO);
    FRTOS1_vTaskDelay((10*1000)/portTICK_RATE_MS);
  #endif
  #if PL_HAS_ACCEL_DEMO
    APP_SetApplicationMode(APP_MODE_ACCEL_DEMO);
    FRTOS1_vTaskDelay((15*1000)/portTICK_RATE_MS);
    ACCEL_StopAccelDemo();
    FRTOS1_vTaskDelay((2*1000)/portTICK_RATE_MS);
  #endif
  #if 0 && PL_HAS_TETRIS_DEMO
    APP_SetApplicationMode(APP_MODE_TETRIS);
    FRTOS1_vTaskDelay((5*1000)/portTICK_RATE_MS);
    TETRIS_KillTask();
    FRTOS1_vTaskDelay((2*1000)/portTICK_RATE_MS);
  #endif
  #if PL_HAS_CUBE_DEMO
    APP_SetApplicationMode(APP_MODE_3D_CUBE);
    FRTOS1_vTaskDelay((8*1000)/portTICK_RATE_MS);
    CUBE_CloseShipWindow();
    FRTOS1_vTaskDelay((2*1000)/portTICK_RATE_MS);
    CUBE_CloseCubeWindow();
    FRTOS1_vTaskDelay((2*1000)/portTICK_RATE_MS);
  #endif
    //APP_SetApplicationMode(APP_MODE_MAIN_MENU);
    //FRTOS1_vTaskDelay((5*1000)/portTICK_RATE_MS);
    heapSize = FRTOS1_xPortGetFreeHeapSize();
#endif
    FRTOS1_vTaskDelay(50/portTICK_RATE_MS);
	} /* for */
}
예제 #18
0
static void Err(void) {
  LED1_On();
  LED2_On();
  LED3_On();
  for(;;){}
}
예제 #19
0
파일: Application.c 프로젝트: tbmathis/SUMO
/*! \brief Handles the Events */
static void APP_EventHandler(EVNT_Handle event) {
	uint8_t err;
  switch(event) {
    case EVNT_INIT:
      LED1_On();
      vTaskDelay(50/portTICK_RATE_MS);
      LED1_Off();
      LED2_On();
      vTaskDelay(50/portTICK_RATE_MS);
      LED2_Off();
      LED3_On();
      vTaskDelay(50/portTICK_RATE_MS);
      LED3_Off();
      break;
    case EVENT_LED_HEARTBEAT:
      LED2_Neg();
      break;
    case EVNT_SW1_PRESSED:
      lastKeyPressed = 1;
      LED1_On();
      vTaskDelay(50/portTICK_RATE_MS);
      LED1_Off();
      //EVNT_SetEvent(EVNT_REF_START_STOP_CALIBRATION);
#if PL_HAS_FIGHT_MODE
      FIGHT_SetState(FIGHT_STATE_COUNTDOWN);
      break;
#endif

#if PL_HAS_LINE_SENSOR
    case EVNT_REF_START_STOP_CALIBRATION: //Create event again, because the event is handled in the "Reflectance.c" directly.
    	if(!EVNT_EventIsSet(EVNT_REF_START_STOP_CALIBRATION))
    	{
    		EVNT_SetEvent(EVNT_REF_START_STOP_CALIBRATION);
    	}

      break;
#endif

#if PL_IS_FRDM
    case EVNT_SW2_PRESSED:
      lastKeyPressed = 2;
      LED1_On();
      vTaskDelay(50/portTICK_RATE_MS);
      LED1_Off();
      break;
    case EVNT_SW3_PRESSED:
      lastKeyPressed = 3;
      LED1_On();
      vTaskDelay(50/portTICK_RATE_MS);
      LED1_Off();
      break;
    case EVNT_SW4_PRESSED:
      lastKeyPressed = 4;
      LED1_On();
      vTaskDelay(50/portTICK_RATE_MS);
      LED1_Off();
      break;
    case EVNT_SW5_PRESSED:
      lastKeyPressed = 5;
      LED1_On();
      vTaskDelay(50/portTICK_RATE_MS);
      LED1_Off();
      break;
    case EVNT_SW6_PRESSED:
      lastKeyPressed = 6;
      LED1_On();
      vTaskDelay(50/portTICK_RATE_MS);
      LED1_Off();
      break;
    case EVNT_SW7_PRESSED:
      lastKeyPressed = 7;
      LED1_On();
      vTaskDelay(50/portTICK_RATE_MS);
      LED1_Off();
      break;
#endif
    default:
      break;
  }
}