Skip to content

Commit 7c4a5ae

Browse files
committed
Read analog pins as digital to try and avoid SD detection badness
1 parent b983e2c commit 7c4a5ae

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

Firmware/RTK_Everywhere/Display.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,10 +2499,10 @@ void paintSystemTest()
24992499
pinMode(pin_muxADC, INPUT_PULLUP);
25002500

25012501
digitalWrite(pin_muxDAC, HIGH);
2502-
if (digitalRead(pin_muxADC) == HIGH)
2502+
if (readAnalogPinAsDigital(pin_muxADC) == HIGH)
25032503
{
25042504
digitalWrite(pin_muxDAC, LOW);
2505-
if (digitalRead(pin_muxADC) == LOW)
2505+
if (readAnalogPinAsDigital(pin_muxADC) == LOW)
25062506
oled->print("OK");
25072507
else
25082508
oled->print("FAIL");

Firmware/RTK_Everywhere/GNSS_UM980.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,9 +1947,9 @@ void um980FirmwareBeginUpdate()
19471947
}
19481948
}
19491949

1950-
if (digitalRead(pin_powerButton) == HIGH)
1950+
if (readAnalogPinAsDigital(pin_powerButton) == HIGH)
19511951
{
1952-
while (digitalRead(pin_powerButton) == HIGH)
1952+
while (readAnalogPinAsDigital(pin_powerButton) == HIGH)
19531953
delay(100);
19541954

19551955
// Remove file and reset to exit pass-through mode

Firmware/RTK_Everywhere/LoRa.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,9 @@ void beginLoraFirmwareUpdate()
482482
while (serialGNSS->available())
483483
Serial.write(serialGNSS->read());
484484

485-
if (digitalRead(pin_powerButton) == HIGH)
485+
if (readAnalogPinAsDigital(pin_powerButton) == HIGH)
486486
{
487-
while (digitalRead(pin_powerButton) == HIGH)
487+
while (readAnalogPinAsDigital(pin_powerButton) == HIGH)
488488
delay(100);
489489

490490
// Remove file and reset to exit LoRa update pass-through mode

Firmware/RTK_Everywhere/SD.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ bool sdCardPresent(void)
8484
{
8585
if (present.microSdCardDetectLow == true)
8686
{
87-
if (digitalRead(pin_microSD_CardDetect) == LOW)
87+
if (readAnalogPinAsDigital(pin_microSD_CardDetect) == LOW)
8888
return (true); // Card detect low = SD in place
8989
return (false); // Card detect high = No SD
9090
}
9191
else if (present.microSdCardDetectHigh == true)
9292
{
93-
if (digitalRead(pin_microSD_CardDetect) == HIGH)
93+
if (readAnalogPinAsDigital(pin_microSD_CardDetect) == HIGH)
9494
return (true); // Card detect high = SD in place
9595
return (false); // Card detect low = No SD
9696
}

Firmware/RTK_Everywhere/System.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ bool isUsbAttached()
770770
{
771771
if (pin_powerAdapterDetect != PIN_UNDEFINED)
772772
// Pin goes low when wall adapter is detected
773-
if (digitalRead(pin_powerAdapterDetect) == HIGH)
773+
if (readAnalogPinAsDigital(pin_powerAdapterDetect) == HIGH)
774774
return false;
775775
return true;
776776
}

0 commit comments

Comments
 (0)