Skip to content

Commit 8aef181

Browse files
committed
Added a fix for issue #39
1 parent d222b95 commit 8aef181

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed
161 KB
Binary file not shown.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Change Log
22
======================
33

4+
v1.7
5+
---------
6+
7+
* Corrected the readVin after sleep bug [39](https://github.com/sparkfun/OpenLog_Artemis/issues/39)
8+
49
v1.6
510
---------
611

Firmware/OpenLog_Artemis/OpenLog_Artemis.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@
6565
(done) Correct the measurement count misbehaviour (Issue #31)
6666
(done) Use the corrected IMU temperature calculation (Issue #28)
6767
(done) Add individual power-on delays for each sensor type. Add an extended delay for the SCD30. (Issue #5)
68+
69+
(done) v1.7: Fix readVin after sleep bug: https://github.com/sparkfun/OpenLog_Artemis/issues/39
6870
*/
6971

7072
const int FIRMWARE_VERSION_MAJOR = 1;
71-
const int FIRMWARE_VERSION_MINOR = 6;
73+
const int FIRMWARE_VERSION_MINOR = 7;
7274

7375
//Define the OLA board identifier:
7476
// This is an int which is unique to this variant of the OLA and which allows us
@@ -78,7 +80,7 @@ const int FIRMWARE_VERSION_MINOR = 6;
7880
// the variant * 0x100 (OLA = 1; GNSS_LOGGER = 2; GEOPHONE_LOGGER = 3)
7981
// the major firmware version * 0x10
8082
// the minor firmware version
81-
#define OLA_IDENTIFIER 0x116
83+
#define OLA_IDENTIFIER 0x117
8284

8385
#include "settings.h"
8486

Firmware/OpenLog_Artemis/lowerPower.ino

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,14 @@ void wakeFromSleep()
321321
am_hal_stimer_config(AM_HAL_STIMER_HFRC_3MHZ);
322322

323323
//Turn on ADC
324-
ap3_adc_setup();
324+
uint32_t adcError = (uint32_t)ap3_adc_setup();
325+
if (settings.logA11 == true) adcError += (uint32_t)ap3_set_pin_to_analog(11); // Set _pad_ 11 to analog if enabled for logging
326+
if (settings.logA12 == true) adcError += (uint32_t)ap3_set_pin_to_analog(12); // Set _pad_ 12 to analog if enabled for logging
327+
if (settings.logA13 == true) adcError += (uint32_t)ap3_set_pin_to_analog(13); // Set _pad_ 13 to analog if enabled for logging
328+
if (settings.logA32 == true) adcError += (uint32_t)ap3_set_pin_to_analog(32); // Set _pad_ 32 to analog if enabled for logging
329+
#if(HARDWARE_VERSION_MAJOR >= 1)
330+
adcError += (uint32_t)ap3_set_pin_to_analog(PIN_VIN_MONITOR); // Set _pad_ PIN_VIN_MONITOR to analog
331+
#endif
325332

326333
//Run setup again
327334

@@ -361,6 +368,10 @@ void wakeFromSleep()
361368
Serial.begin(settings.serialTerminalBaudRate);
362369

363370
printDebug("wakeFromSleep: I'm awake!\r\n");
371+
printDebug("wakeFromSleep: adcError is " + (String)adcError + ".");
372+
if (adcError > 0)
373+
printDebug(" This indicates an error was returned by ap3_adc_setup or one of the calls to ap3_set_pin_to_analog.");
374+
printDebug("\r\n");
364375

365376
beginQwiic(); //Power up Qwiic bus as early as possible
366377

0 commit comments

Comments
 (0)