mirror of
https://github.com/dougg3/mac-rom-simm-programmer.git
synced 2024-11-21 15:32:14 +00:00
Add ability for status LED to be inverted
This commit is contained in:
parent
df5c50ffee
commit
b1ab4ece95
12
led.h
12
led.h
@ -27,6 +27,8 @@
|
|||||||
#include "hal/board.h"
|
#include "hal/board.h"
|
||||||
#include "hal/gpio.h"
|
#include "hal/gpio.h"
|
||||||
|
|
||||||
|
static inline void LED_Off(void);
|
||||||
|
|
||||||
/** Initializes the LED and turns it off
|
/** Initializes the LED and turns it off
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -34,7 +36,7 @@ static inline void LED_Init(void)
|
|||||||
{
|
{
|
||||||
GPIOPin ledPin = Board_LEDPin();
|
GPIOPin ledPin = Board_LEDPin();
|
||||||
GPIO_SetDirection(ledPin, true);
|
GPIO_SetDirection(ledPin, true);
|
||||||
GPIO_SetOff(ledPin);
|
LED_Off();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Turns the LED on
|
/** Turns the LED on
|
||||||
@ -42,7 +44,11 @@ static inline void LED_Init(void)
|
|||||||
*/
|
*/
|
||||||
static inline void LED_On(void)
|
static inline void LED_On(void)
|
||||||
{
|
{
|
||||||
|
#if BOARD_LED_INVERTED
|
||||||
|
GPIO_SetOff(Board_LEDPin());
|
||||||
|
#else
|
||||||
GPIO_SetOn(Board_LEDPin());
|
GPIO_SetOn(Board_LEDPin());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Turns the LED off
|
/** Turns the LED off
|
||||||
@ -50,7 +56,11 @@ static inline void LED_On(void)
|
|||||||
*/
|
*/
|
||||||
static inline void LED_Off(void)
|
static inline void LED_Off(void)
|
||||||
{
|
{
|
||||||
|
#if BOARD_LED_INVERTED
|
||||||
|
GPIO_SetOn(Board_LEDPin());
|
||||||
|
#else
|
||||||
GPIO_SetOff(Board_LEDPin());
|
GPIO_SetOff(Board_LEDPin());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Toggles the LED
|
/** Toggles the LED
|
||||||
|
Loading…
Reference in New Issue
Block a user