Skip to content

Commit 0436354

Browse files
committed
Ensure pull-ups are enabled on Serial1 Rx and the interrupt pins
1 parent b4f13bb commit 0436354

File tree

7 files changed

+62
-37
lines changed

7 files changed

+62
-37
lines changed

Firmware/OpenLog_Artemis/OpenLog_Artemis.ino

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,10 @@
9898
(worked around) Figure out why attachInterrupt(PIN_POWER_LOSS, powerDownOLA, FALLING); causes badness
9999
(done) Add a setQwiicPullups function
100100
(done) Check if we need ap3_set_pin_to_analog when coming out of sleep
101-
(done?) Investigate why code does not wake from deep sleep correctly
101+
(done) Investigate why code does not wake from deep sleep correctly
102102
(worked around) Correct SerialLog RX: https://github.com/sparkfun/Arduino_Apollo3/issues/401
103103
The work-around is to use Serial1 in place of serialLog and then to manually force UART1 to use pins 12 and 13
104104
We need a work-around anyway because if pins 12 or 13 have been used as analog inputs, Serial1.begin does not re-configure them for UART TX and RX
105-
(TO DO) Figure out why we actually need something connected to the RX pin on start up when using the Tx and Rx pins for the terminal
106105
(in progress) Reduce sleep current as much as possible. v1.2.1 achieved ~110uA. With v2.1.1 the draw is more like 280uA...
107106
*/
108107

@@ -388,6 +387,7 @@ void setup() {
388387
pinMode(PIN_STOP_LOGGING, INPUT_PULLUP);
389388
delay(1); // Let the pin stabilize
390389
attachInterrupt(PIN_STOP_LOGGING, stopLoggingISR, FALLING); // Enable the interrupt
390+
pin_config(PinName(PIN_STOP_LOGGING), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pull-up does actually stay enabled
391391
stopLoggingSeen = false; // Make sure the flag is clear
392392
}
393393

@@ -405,6 +405,7 @@ void setup() {
405405
SerialPrintln(F("Rising-edge triggering is enabled. Sensor data will be logged on a rising edge on GPIO pin 11."));
406406
attachInterrupt(PIN_TRIGGER, triggerPinISR, RISING); // Enable the interrupt
407407
}
408+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pull-up does actually stay enabled
408409
triggerEdgeSeen = false; // Make sure the flag is clear
409410
}
410411

@@ -829,7 +830,7 @@ bool checkSleepOnRTCTime(void)
829830
void beginQwiic()
830831
{
831832
pinMode(PIN_QWIIC_POWER, OUTPUT);
832-
pin_config(PinName(PIN_QWIIC_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
833+
pin_config(PinName(PIN_QWIIC_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
833834
qwiicPowerOn();
834835
qwiic.begin();
835836
setQwiicPullups(settings.qwiicBusPullUps); //Just to make it really clear what pull-ups are being used, set pullups here.
@@ -874,9 +875,9 @@ void setQwiicPullups(uint32_t qwiicBusPullUps)
874875
void beginSD()
875876
{
876877
pinMode(PIN_MICROSD_POWER, OUTPUT);
877-
pin_config(PinName(PIN_MICROSD_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
878+
pin_config(PinName(PIN_MICROSD_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
878879
pinMode(PIN_MICROSD_CHIP_SELECT, OUTPUT);
879-
pin_config(PinName(PIN_MICROSD_CHIP_SELECT), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
880+
pin_config(PinName(PIN_MICROSD_CHIP_SELECT), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
880881
digitalWrite(PIN_MICROSD_CHIP_SELECT, HIGH); //Be sure SD is deselected
881882

882883
if (settings.enableSD == true)
@@ -952,15 +953,16 @@ void configureSerial1TxRx(void) // Configure pins 12 and 13 for UART1 TX and RX
952953
pin_config(PinName(BREAKOUT_PIN_TX), pinConfigTx);
953954
am_hal_gpio_pincfg_t pinConfigRx = g_AM_BSP_GPIO_COM_UART_RX;
954955
pinConfigRx.uFuncSel = AM_HAL_PIN_13_UART1RX;
956+
pinConfigRx.ePullup = AM_HAL_GPIO_PIN_PULLUP_WEAK; // Put a weak pull-up on the Rx pin
955957
pin_config(PinName(BREAKOUT_PIN_RX), pinConfigRx);
956958
}
957959

958960
void beginIMU()
959961
{
960962
pinMode(PIN_IMU_POWER, OUTPUT);
961-
pin_config(PinName(PIN_IMU_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
963+
pin_config(PinName(PIN_IMU_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
962964
pinMode(PIN_IMU_CHIP_SELECT, OUTPUT);
963-
pin_config(PinName(PIN_IMU_CHIP_SELECT), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
965+
pin_config(PinName(PIN_IMU_CHIP_SELECT), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
964966
digitalWrite(PIN_IMU_CHIP_SELECT, HIGH); //Be sure IMU is deselected
965967

966968
if (settings.enableIMU == true && settings.logMaxRate == false)

Firmware/OpenLog_Artemis/lowerPower.ino

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,12 @@ void goToSleep(uint32_t sysTicksToSleep)
317317
am_hal_gpio_pinconfig(PIN_QWIIC_SDA , g_AM_HAL_GPIO_DISABLE);
318318
am_hal_gpio_pinconfig(PIN_QWIIC_SCL , g_AM_HAL_GPIO_DISABLE);
319319

320-
//Do disable pins 48 and 49 (UART0) to stop them back-feeding the CH340
321-
am_hal_gpio_pinconfig(48 , g_AM_HAL_GPIO_DISABLE); //TX0
322-
am_hal_gpio_pinconfig(49 , g_AM_HAL_GPIO_DISABLE); //RX0
320+
//If requested, disable pins 48 and 49 (UART0) to stop them back-feeding the CH340
321+
if (settings.serialTxRxDuringSleep == false)
322+
{
323+
am_hal_gpio_pinconfig(48 , g_AM_HAL_GPIO_DISABLE); //TX0
324+
am_hal_gpio_pinconfig(49 , g_AM_HAL_GPIO_DISABLE); //RX0
325+
}
323326

324327
//Make sure PIN_POWER_LOSS is configured as an input for the WDT
325328
pinMode(PIN_POWER_LOSS, INPUT); // BD49K30G-TL has CMOS output and does not need a pull-up
@@ -405,7 +408,7 @@ void wakeFromSleep()
405408

406409
//If 3.3V rail drops below 3V, system will enter low power mode and maintain RTC
407410
pinMode(PIN_POWER_LOSS, INPUT); // BD49K30G-TL has CMOS output and does not need a pull-up
408-
pin_config(PinName(PIN_POWER_LOSS), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured after being disabled
411+
pin_config(PinName(PIN_POWER_LOSS), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured
409412

410413
delay(1); // Let PIN_POWER_LOSS stabilize
411414

@@ -418,39 +421,44 @@ void wakeFromSleep()
418421
if (settings.useGPIO32ForStopLogging == true)
419422
{
420423
pinMode(PIN_STOP_LOGGING, INPUT_PULLUP);
421-
pin_config(PinName(PIN_STOP_LOGGING), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pin does actually get re-configured after being disabled
424+
pin_config(PinName(PIN_STOP_LOGGING), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pin does actually get re-configured
422425
delay(1); // Let the pin stabilize
423426
attachInterrupt(PIN_STOP_LOGGING, stopLoggingISR, FALLING); // Enable the interrupt
427+
pin_config(PinName(PIN_STOP_LOGGING), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pull-up does actually stay enabled
424428
stopLoggingSeen = false; // Make sure the flag is clear
425429
}
426430

427431
if (settings.useGPIO11ForTrigger == true) //(This should be redundant. We should not be going to sleep if triggering is enabled?)
428432
{
429433
pinMode(PIN_TRIGGER, INPUT_PULLUP);
430-
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pin does actually get re-configured after being disabled
434+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pin does actually get re-configured
431435
delay(1); // Let the pin stabilize
432436
if (settings.fallingEdgeTrigger == true)
433437
attachInterrupt(PIN_TRIGGER, triggerPinISR, FALLING); // Enable the interrupt
434438
else
435439
attachInterrupt(PIN_TRIGGER, triggerPinISR, RISING); // Enable the interrupt
440+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pull-up does actually stay enabled
436441
triggerEdgeSeen = false; // Make sure the flag is clear
437442
}
438443

439444
if (settings.useGPIO11ForFastSlowLogging == true)
440445
{
441446
pinMode(PIN_TRIGGER, INPUT_PULLUP);
442-
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pin does actually get re-configured after being disabled
447+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pin does actually get re-configured
443448
}
444449

445450
pinMode(PIN_STAT_LED, OUTPUT);
446-
pin_config(PinName(PIN_STAT_LED), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
451+
pin_config(PinName(PIN_STAT_LED), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
447452
digitalWrite(PIN_STAT_LED, LOW);
448453

449454
powerLEDOn();
450455

451-
//Re-enable pins 48 and 49 (UART0)
452-
pin_config(PinName(48), g_AM_BSP_GPIO_COM_UART_TX);
453-
pin_config(PinName(49), g_AM_BSP_GPIO_COM_UART_RX);
456+
//Re-enable pins 48 and 49 (UART0) if requested
457+
if (settings.serialTxRxDuringSleep == false)
458+
{
459+
pin_config(PinName(48), g_AM_BSP_GPIO_COM_UART_TX);
460+
pin_config(PinName(49), g_AM_BSP_GPIO_COM_UART_RX);
461+
}
454462

455463
//Re-enable CIPO, COPI, SCK and the chip selects but may as well leave ICM_INT disabled
456464
pin_config(PinName(PIN_SPI_CIPO), g_AM_BSP_GPIO_IOM0_MISO);
@@ -553,7 +561,7 @@ void waitForQwiicBusPowerDelay() // Wait while the qwiic devices power up
553561
void qwiicPowerOn()
554562
{
555563
pinMode(PIN_QWIIC_POWER, OUTPUT);
556-
pin_config(PinName(PIN_QWIIC_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
564+
pin_config(PinName(PIN_QWIIC_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
557565
#if(HARDWARE_VERSION_MAJOR == 0)
558566
digitalWrite(PIN_QWIIC_POWER, LOW);
559567
#else
@@ -565,7 +573,7 @@ void qwiicPowerOn()
565573
void qwiicPowerOff()
566574
{
567575
pinMode(PIN_QWIIC_POWER, OUTPUT);
568-
pin_config(PinName(PIN_QWIIC_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
576+
pin_config(PinName(PIN_QWIIC_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
569577
#if(HARDWARE_VERSION_MAJOR == 0)
570578
digitalWrite(PIN_QWIIC_POWER, HIGH);
571579
#else
@@ -576,42 +584,42 @@ void qwiicPowerOff()
576584
void microSDPowerOn()
577585
{
578586
pinMode(PIN_MICROSD_POWER, OUTPUT);
579-
pin_config(PinName(PIN_MICROSD_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
587+
pin_config(PinName(PIN_MICROSD_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
580588
digitalWrite(PIN_MICROSD_POWER, LOW);
581589
}
582590
void microSDPowerOff()
583591
{
584592
pinMode(PIN_MICROSD_POWER, OUTPUT);
585-
pin_config(PinName(PIN_MICROSD_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
593+
pin_config(PinName(PIN_MICROSD_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
586594
digitalWrite(PIN_MICROSD_POWER, HIGH);
587595
}
588596

589597
void imuPowerOn()
590598
{
591599
pinMode(PIN_IMU_POWER, OUTPUT);
592-
pin_config(PinName(PIN_IMU_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
600+
pin_config(PinName(PIN_IMU_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
593601
digitalWrite(PIN_IMU_POWER, HIGH);
594602
}
595603
void imuPowerOff()
596604
{
597605
pinMode(PIN_IMU_POWER, OUTPUT);
598-
pin_config(PinName(PIN_IMU_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
606+
pin_config(PinName(PIN_IMU_POWER), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
599607
digitalWrite(PIN_IMU_POWER, LOW);
600608
}
601609

602610
void powerLEDOn()
603611
{
604612
#if(HARDWARE_VERSION_MAJOR >= 1)
605613
pinMode(PIN_PWR_LED, OUTPUT);
606-
pin_config(PinName(PIN_PWR_LED), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
614+
pin_config(PinName(PIN_PWR_LED), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
607615
digitalWrite(PIN_PWR_LED, HIGH); // Turn the Power LED on
608616
#endif
609617
}
610618
void powerLEDOff()
611619
{
612620
#if(HARDWARE_VERSION_MAJOR >= 1)
613621
pinMode(PIN_PWR_LED, OUTPUT);
614-
pin_config(PinName(PIN_PWR_LED), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured after being disabled
622+
pin_config(PinName(PIN_PWR_LED), g_AM_HAL_GPIO_OUTPUT); // Make sure the pin does actually get re-configured
615623
digitalWrite(PIN_PWR_LED, LOW); // Turn the Power LED off
616624
#endif
617625
}

Firmware/OpenLog_Artemis/menuAnalogLogging.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void menuAnalogLogging()
5656
settings.useGPIO11ForTrigger = false;
5757
detachInterrupt(PIN_TRIGGER); // Disable the interrupt
5858
pinMode(PIN_TRIGGER, INPUT); // Remove the pull-up
59-
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured after being disabled
59+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured
6060
triggerEdgeSeen = false; // Make sure the flag is clear
6161
}
6262
else
@@ -120,7 +120,7 @@ void menuAnalogLogging()
120120
settings.useGPIO32ForStopLogging = false;
121121
detachInterrupt(PIN_STOP_LOGGING); // Disable the interrupt
122122
pinMode(PIN_STOP_LOGGING, INPUT); // Remove the pull-up
123-
pin_config(PinName(PIN_STOP_LOGGING), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured after being disabled
123+
pin_config(PinName(PIN_STOP_LOGGING), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured
124124
}
125125
else
126126
settings.logA32 = false;

Firmware/OpenLog_Artemis/menuPower.ino

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ void menuPower()
3232
SerialPrintf2("%s\r\n", tempStr);
3333
#endif
3434

35+
SerialPrint(F("7) Serial Tx and Rx pins during sleep are: "));
36+
if (settings.serialTxRxDuringSleep == true) SerialPrintln(F("Enabled"));
37+
else SerialPrintln(F("Disabled"));
38+
3539
SerialPrintln(F("x) Exit"));
3640

3741
byte incoming = getByteChoice(menuTimeout); //Timeout after x seconds
@@ -50,17 +54,18 @@ void menuPower()
5054
settings.useGPIO32ForStopLogging = false;
5155
detachInterrupt(PIN_STOP_LOGGING); // Disable the interrupt
5256
pinMode(PIN_STOP_LOGGING, INPUT); // Remove the pull-up
53-
pin_config(PinName(PIN_STOP_LOGGING), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured after being disabled
57+
pin_config(PinName(PIN_STOP_LOGGING), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured
5458
stopLoggingSeen = false; // Make sure the flag is clear
5559
}
5660
else
5761
{
5862
// Enable stop logging
5963
settings.useGPIO32ForStopLogging = true;
6064
pinMode(PIN_STOP_LOGGING, INPUT_PULLUP);
61-
pin_config(PinName(PIN_STOP_LOGGING), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pin does actually get re-configured after being disabled
65+
pin_config(PinName(PIN_STOP_LOGGING), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pin does actually get re-configured
6266
delay(1); // Let the pin stabilize
6367
attachInterrupt(PIN_STOP_LOGGING, stopLoggingISR, FALLING); // Enable the interrupt
68+
pin_config(PinName(PIN_STOP_LOGGING), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pull-up does actually stay enabled
6469
stopLoggingSeen = false; // Make sure the flag is clear
6570
settings.logA32 = false; // Disable analog logging on pin 32
6671
}
@@ -103,6 +108,10 @@ void menuPower()
103108
settings.vinCorrectionFactor = tempCF;
104109
}
105110
#endif
111+
else if (incoming == '7')
112+
{
113+
settings.serialTxRxDuringSleep ^= 1;
114+
}
106115
else if (incoming == 'x')
107116
break;
108117
else if (incoming == STATUS_GETBYTE_TIMEOUT)

Firmware/OpenLog_Artemis/menuTerminal.ino

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,20 +288,21 @@ void menuLogRate()
288288
settings.useGPIO11ForTrigger = false;
289289
detachInterrupt(PIN_TRIGGER); // Disable the interrupt
290290
pinMode(PIN_TRIGGER, INPUT); // Remove the pull-up
291-
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured after being disabled
291+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured
292292
triggerEdgeSeen = false; // Make sure the flag is clear
293293
}
294294
else
295295
{
296296
// Enable triggering
297297
settings.useGPIO11ForTrigger = true;
298298
pinMode(PIN_TRIGGER, INPUT_PULLUP);
299-
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pin does actually get re-configured after being disabled
299+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pin does actually get re-configured
300300
delay(1); // Let the pin stabilize
301301
if (settings.fallingEdgeTrigger == true)
302302
attachInterrupt(PIN_TRIGGER, triggerPinISR, FALLING); // Enable the interrupt
303303
else
304304
attachInterrupt(PIN_TRIGGER, triggerPinISR, RISING); // Enable the interrupt
305+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pull-up does actually stay enabled
305306
triggerEdgeSeen = false; // Make sure the flag is clear
306307
settings.logA11 = false; // Disable analog logging on pin 11
307308
settings.logMaxRate = false; // Disable max rate logging
@@ -328,6 +329,7 @@ void menuLogRate()
328329
attachInterrupt(PIN_TRIGGER, triggerPinISR, FALLING); // Enable the interrupt
329330
else
330331
attachInterrupt(PIN_TRIGGER, triggerPinISR, RISING); // Enable the interrupt
332+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pull-up does actually stay enabled
331333
triggerEdgeSeen = false; // Make sure the flag is clear
332334
}
333335
else
@@ -392,7 +394,7 @@ void menuLogRate()
392394
settings.useRTCForFastSlowLogging = false;
393395
settings.logA11 = false; // Disable analog logging on pin 11
394396
pinMode(PIN_TRIGGER, INPUT_PULLUP);
395-
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pin does actually get re-configured after being disabled
397+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pin does actually get re-configured
396398
delay(1); // Let the pin stabilize
397399
// Disable triggering
398400
if (settings.useGPIO11ForTrigger == true)
@@ -406,7 +408,7 @@ void menuLogRate()
406408
{
407409
settings.useGPIO11ForFastSlowLogging = false;
408410
pinMode(PIN_TRIGGER, INPUT); // Remove the pull-up
409-
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured after being disabled
411+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured
410412
}
411413
}
412414
else
@@ -429,7 +431,7 @@ void menuLogRate()
429431
{
430432
settings.useGPIO11ForFastSlowLogging = false;
431433
pinMode(PIN_TRIGGER, INPUT); // Remove the pull-up
432-
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured after being disabled
434+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured
433435
}
434436
}
435437
else if (incoming == 17)
@@ -440,7 +442,7 @@ void menuLogRate()
440442
if (settings.useGPIO11ForFastSlowLogging == true)
441443
{
442444
pinMode(PIN_TRIGGER, INPUT); // Remove the pull-up
443-
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured after being disabled
445+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured
444446
}
445447
settings.useGPIO11ForFastSlowLogging = false;
446448
settings.logA11 = false; // Disable analog logging on pin 11
@@ -449,7 +451,7 @@ void menuLogRate()
449451
{
450452
detachInterrupt(PIN_TRIGGER); // Disable the interrupt
451453
pinMode(PIN_TRIGGER, INPUT); // Remove the pull-up
452-
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured after being disabled
454+
pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT); // Make sure the pin does actually get re-configured
453455
triggerEdgeSeen = false; // Make sure the flag is clear
454456
}
455457
settings.useGPIO11ForTrigger = false;

0 commit comments

Comments
 (0)