Added BiColour led behaviour to menu
git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@360 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -102,16 +102,27 @@ ErrorStatus Led_construct(struct Gpio* onboardGreen, struct Gpio* onboardOrange,
|
||||
extern void Led_on(Led led)
|
||||
{
|
||||
char bufferTrue = (char)true;
|
||||
char bufferFalse = (char)false;
|
||||
if (self.initialized)
|
||||
{
|
||||
if (self.leds[led].initialized)
|
||||
{
|
||||
// IN case of the BICOLOUR ORANGE LED, actually the GREEN and RED LEDs must be switched
|
||||
// IN case of the BICOLOUR LED, actually the GREEN and RED LEDs must be switched
|
||||
if (led == LED_BICOLOR_ORANGE)
|
||||
{
|
||||
IODevice_write(self.leds[LED_BICOLOR_GREEN].ioDevice, &bufferTrue, 1);
|
||||
IODevice_write(self.leds[LED_BICOLOR_RED].ioDevice, &bufferTrue, 1);
|
||||
}
|
||||
else if (led == LED_BICOLOR_GREEN)
|
||||
{
|
||||
IODevice_write(self.leds[LED_BICOLOR_GREEN].ioDevice, &bufferTrue, 1);
|
||||
IODevice_write(self.leds[LED_BICOLOR_RED].ioDevice, &bufferFalse, 1);
|
||||
}
|
||||
else if (led == LED_BICOLOR_RED)
|
||||
{
|
||||
IODevice_write(self.leds[LED_BICOLOR_GREEN].ioDevice, &bufferFalse, 1);
|
||||
IODevice_write(self.leds[LED_BICOLOR_RED].ioDevice, &bufferTrue, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
IODevice_write(self.leds[led].ioDevice, &bufferTrue, 1);
|
||||
@@ -135,6 +146,7 @@ extern void Led_off(Led led)
|
||||
IODevice_write(self.leds[LED_BICOLOR_GREEN].ioDevice, &bufferFalse, 1);
|
||||
IODevice_write(self.leds[LED_BICOLOR_RED].ioDevice, &bufferFalse, 1);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
IODevice_write(self.leds[led].ioDevice, &bufferFalse, 1);
|
||||
|
||||
Reference in New Issue
Block a user