@@ -657,7 +657,9 @@ void SerialInterface::runCommand(String input) {
657
657
// ===== STOP ===== //
658
658
// stop [<mode>]
659
659
else if (eqlsCMD (0 , CLI_STOP)) {
660
+ #ifdef DIGITAL_LED
660
661
led.setMode (LED_MODE_IDLE, true );
662
+ #endif
661
663
if (list->size () >= 2 && !(eqlsCMD (1 , CLI_ALL))) {
662
664
for (int i = 1 ; i < list->size (); i++) {
663
665
if (eqlsCMD (i, CLI_SCAN)) scan.stop ();
@@ -930,30 +932,45 @@ void SerialInterface::runCommand(String input) {
930
932
// ===== LED ===== //
931
933
// led <r> <g> <b> [<brightness>]
932
934
else if (list->size () >= 4 && list->size () <= 5 && eqlsCMD (0 , CLI_LED)) {
933
- if (list->size () == 4 )
935
+ if (list->size () == 4 ) {
936
+ #ifdef DIGITAL_LED
934
937
led.setColor (list->get (1 ).toInt (), list->get (2 ).toInt (), list->get (3 ).toInt ());
935
- else
938
+ #endif
939
+ } else {
940
+ #ifdef DIGITAL_LED
936
941
led.setColor (list->get (1 ).toInt (), list->get (2 ).toInt (), list->get (3 ).toInt (), list->get (4 ).toInt ());
942
+ #endif
943
+ }
937
944
}
938
945
939
946
// led <#rrggbb> [<brightness>]
940
947
else if (list->size () >= 2 && list->size () <= 3 && eqlsCMD (0 , CLI_LED) && list->get (1 ).charAt (0 ) == HASHSIGN) {
941
948
uint8_t c[3 ];
942
949
strToColor (list->get (1 ), c);
943
- if (list->size () == 2 )
950
+ if (list->size () == 2 ) {
951
+ #ifdef DIGITAL_LED
944
952
led.setColor (c[0 ], c[1 ], c[2 ]);
945
- else
953
+ #endif
954
+ } else {
955
+ #ifdef DIGITAL_LED
946
956
led.setColor (c[0 ], c[1 ], c[2 ], list->get (2 ).toInt ());
957
+ #endif
958
+ }
947
959
}
948
960
949
961
// led <enable/disable>
950
962
else if (list->size () == 2 && eqlsCMD (0 , CLI_LED)) {
951
- if (eqlsCMD (1 , CLI_ENABLE))
963
+ if (eqlsCMD (1 , CLI_ENABLE)) {
964
+ #ifdef DIGITAL_LED
952
965
led.tempEnable ();
953
- else if (eqlsCMD (1 , CLI_DISABLE))
966
+ #endif
967
+ } else if (eqlsCMD (1 , CLI_DISABLE)) {
968
+ #ifdef DIGITAL_LED
954
969
led.tempDisable ();
955
- else
970
+ #endif
971
+ } else {
956
972
parameterError (list->get (1 ));
973
+ }
957
974
958
975
}
959
976
@@ -968,7 +985,9 @@ void SerialInterface::runCommand(String input) {
968
985
scan.update (); // run scan
969
986
attack.update (); // run attacks
970
987
ssids.update (); // run random mode, if enabled
988
+ #ifdef DIGITAL_LED
971
989
led.update (); // update LED color
990
+ #endif
972
991
973
992
// auto-save
974
993
if (settings.getAutosave () && currentTime - autosaveTime > settings.getAutosaveTime ()) {
@@ -1121,4 +1140,4 @@ void SerialInterface::runCommand(String input) {
1121
1140
}
1122
1141
}
1123
1142
1124
-
1143
+
0 commit comments