|
13 | 13 |
|
14 | 14 | The Board should be set to SparkFun Apollo3 \ RedBoard Artemis ATP. |
15 | 15 |
|
16 | | - Please note: this version of the firmware compiles on v2.1.0+ of the Apollo3 boards. |
| 16 | + Please note: this version of the firmware compiles on v2.1.0 of the Apollo3 boards. |
| 17 | + |
| 18 | + (At the time of writing, data logging with the the u-blox ZED-F9P is problematic when using v2.1.1 of the core.) |
17 | 19 |
|
18 | 20 | v1.0 Power Consumption: |
19 | 21 | Sleep between reads, RTC fully charged, no Qwiic, SD, no USB, no Power LED: 260uA |
|
95 | 97 | |
96 | 98 | (in progress) Update to Apollo3 v2.1.1 - FIRMWARE_VERSION_MAJOR = 2. |
97 | 99 | (done) Implement printf float (OLA uses printf float in _so_ many places...): https://github.com/sparkfun/Arduino_Apollo3/issues/278 |
98 | | - (worked around) Figure out why attachInterrupt(PIN_POWER_LOSS, powerDownOLA, FALLING); causes badness |
| 100 | + (worked around) attachInterrupt(PIN_POWER_LOSS, powerDownOLA, FALLING); causes badness - https://github.com/sparkfun/Arduino_Apollo3/issues/416 |
99 | 101 | (done) Add a setQwiicPullups function |
100 | 102 | (done) Check if we need ap3_set_pin_to_analog when coming out of sleep |
101 | 103 | (done) Investigate why code does not wake from deep sleep correctly |
@@ -326,7 +328,7 @@ void setup() { |
326 | 328 | delay(1); // Let PIN_POWER_LOSS stabilize |
327 | 329 |
|
328 | 330 | if (digitalRead(PIN_POWER_LOSS) == LOW) powerDownOLA(); //Check PIN_POWER_LOSS just in case we missed the falling edge |
329 | | - //attachInterrupt(PIN_POWER_LOSS, powerDownOLA, FALLING); // TO DO: figure out why this no longer works on v2.1.0 |
| 331 | + //attachInterrupt(PIN_POWER_LOSS, powerDownOLA, FALLING); // We can't do this with v2.1.0 as attachInterrupt causes a spontaneous interrupt |
330 | 332 | attachInterrupt(PIN_POWER_LOSS, powerLossISR, FALLING); |
331 | 333 | powerLossSeen = false; // Make sure the flag is clear |
332 | 334 |
|
@@ -387,25 +389,30 @@ void setup() { |
387 | 389 | pinMode(PIN_STOP_LOGGING, INPUT_PULLUP); |
388 | 390 | delay(1); // Let the pin stabilize |
389 | 391 | 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 |
| 392 | + am_hal_gpio_pincfg_t intPinConfig = g_AM_HAL_GPIO_INPUT_PULLUP; |
| 393 | + intPinConfig.eIntDir = AM_HAL_GPIO_PIN_INTDIR_HI2LO; |
| 394 | + pin_config(PinName(PIN_STOP_LOGGING), intPinConfig); // Make sure the pull-up does actually stay enabled |
391 | 395 | stopLoggingSeen = false; // Make sure the flag is clear |
392 | 396 | } |
393 | 397 |
|
394 | 398 | if (settings.useGPIO11ForTrigger == true) |
395 | 399 | { |
396 | 400 | pinMode(PIN_TRIGGER, INPUT_PULLUP); |
397 | 401 | delay(1); // Let the pin stabilize |
| 402 | + am_hal_gpio_pincfg_t intPinConfig = g_AM_HAL_GPIO_INPUT_PULLUP; |
398 | 403 | if (settings.fallingEdgeTrigger == true) |
399 | 404 | { |
400 | 405 | SerialPrintln(F("Falling-edge triggering is enabled. Sensor data will be logged on a falling edge on GPIO pin 11.")); |
401 | 406 | attachInterrupt(PIN_TRIGGER, triggerPinISR, FALLING); // Enable the interrupt |
| 407 | + intPinConfig.eIntDir = AM_HAL_GPIO_PIN_INTDIR_HI2LO; |
402 | 408 | } |
403 | 409 | else |
404 | 410 | { |
405 | 411 | SerialPrintln(F("Rising-edge triggering is enabled. Sensor data will be logged on a rising edge on GPIO pin 11.")); |
406 | 412 | attachInterrupt(PIN_TRIGGER, triggerPinISR, RISING); // Enable the interrupt |
| 413 | + intPinConfig.eIntDir = AM_HAL_GPIO_PIN_INTDIR_LO2HI; |
407 | 414 | } |
408 | | - pin_config(PinName(PIN_TRIGGER), g_AM_HAL_GPIO_INPUT_PULLUP); // Make sure the pull-up does actually stay enabled |
| 415 | + pin_config(PinName(PIN_TRIGGER), intPinConfig); // Make sure the pull-up does actually stay enabled |
409 | 416 | triggerEdgeSeen = false; // Make sure the flag is clear |
410 | 417 | } |
411 | 418 |
|
|
0 commit comments