void LED_Set(unsigned char SET,unsigned char id) { unsigned char LEDPort = LED_ConfigData[id].LEDPort; unsigned char LEDMask = LED_ConfigData[id].LEDMask; DIO_vidWritePortData(LEDPort,LEDMask,SET); Toggle[id] = SET; }
void LEDS_Flash_FULL(void) { if(ledFlag_FULL) { DIO_vidWritePortData(PB,LED_Half,0); ledFlag_FULL = 0; /*there is a hazard at the first flash only */ DIO_vidTogglePortData(PB,LED_Full); /*toggle led every 250 ms*/ } }
void LEDS_Flash_LEFT(void) { if( (ledFlag_LEFT) ) { DIO_vidWritePortData(PB,LED_Right,0); ledFlag_LEFT = 0; /*there is a hazard at the first flash only */ DIO_vidTogglePortData(PB,LED_Left); /*toggle led every 250 ms*/ } }
void LEDS_Flash_RIGHT(void) { if((ledFlag_RIGHT)) { DIO_vidWritePortData(PB,LED_Left,0); ledFlag_RIGHT =0; DIO_vidTogglePortData(PB,LED_Right); /*toggle led every 250 ms*/ } }
void LED_Init(void) { unsigned char LoopIndex; unsigned char LEDPort; unsigned char LEDMask; for(LoopIndex = 0 ; LoopIndex < LED_NUM ; LoopIndex ++) { LEDPort = LED_ConfigData[LoopIndex].LEDPort; LEDMask = LED_ConfigData[LoopIndex].LEDMask; DIO_vidWritePortDirection(LEDPort,LEDMask,0xFF); DIO_vidWritePortData(LEDPort,LEDMask,ON); } }
void LEDS_Stop(unsigned char led) { DIO_vidWritePortData(PB,led,0); }