]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Added some LED utility functions (#802)
authorSamson Gama <sgama@users.noreply.github.com>
Fri, 15 Mar 2019 06:41:07 +0000 (23:41 -0700)
committerpwpiwi <pwpiwi@users.noreply.github.com>
Fri, 15 Mar 2019 06:41:07 +0000 (07:41 +0100)
armsrc/appmain.c
armsrc/iclass.c
armsrc/util.c
armsrc/util.h

index 2a16f5f0e70b418b7014259a4b6fce9ff43c8ff2..8824847e4c437b93818bfd1e92445b7cce3c5f37 100644 (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();
 
index be7da703c7399bf007799643af39c3bd3385804b..83c9a75b76d9c6d6cc9d724fee8b223d5d67e546 100644 (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) {
index fbb6d48914e1be1e6c63192e554f33be170323ed..aac68a344f74ddd9bca70e9015a03a8851d86127 100644 (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)
 {
index fb50ecc86e0ea91b031d354869af5741e46de50d..da333e0102bb83be995b4997fad83cc01427d8aa 100644 (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);
Impressum, Datenschutz