Added some LED utility functions (#802)

This commit is contained in:
Samson Gama 2019-03-14 23:41:07 -07:00 committed by pwpiwi
parent 5866c187ef
commit 3d057cfb91
4 changed files with 21 additions and 9 deletions

View file

@ -1490,11 +1490,8 @@ void __attribute__((noreturn)) AppMain(void)
}
common_area.flags.osimage_present = 1;
LED_D_OFF();
LED_C_OFF();
LED_B_OFF();
LED_A_OFF();
LEDsoff();
// Init USB device
usb_enable();

View file

@ -810,10 +810,7 @@ done:
AT91C_BASE_PDC_SSC->PDC_PTCR = AT91C_PDC_RXTDIS;
Dbprintf("%x %x %x", maxBehindBy, Uart.state, Uart.byteCnt);
Dbprintf("%x %x %x", Uart.byteCntMax, BigBuf_get_traceLen(), (int)Uart.output[0]);
LED_A_OFF();
LED_B_OFF();
LED_C_OFF();
LED_D_OFF();
LEDsoff();
}
void rotateCSN(uint8_t* originalCSN, uint8_t* rotatedCSN) {

View file

@ -89,6 +89,22 @@ void LEDsoff()
LED_D_OFF();
}
void LEDson()
{
LED_A_ON();
LED_B_ON();
LED_C_ON();
LED_D_ON();
}
void LEDsinvert()
{
LED_A_INV();
LED_B_INV();
LED_C_INV();
LED_D_INV();
}
// LEDs: R(C) O(A) G(B) -- R(D) [1, 2, 4 and 8]
void LED(int led, int ms)
{

View file

@ -37,6 +37,8 @@ void lsl (uint8_t *data, size_t len);
void LED(int led, int ms);
void LEDsoff();
void LEDson();
void LEDsinvert();
int BUTTON_CLICKED(int ms);
int BUTTON_HELD(int ms);
void FormatVersionInformation(char *dst, int len, const char *prefix, void *version_information);