I'm not familiar enough yet with how the adc is configured and used and reused, but in debugging my program I've found that if I call the GetBatteryVoltage() function anywhere in my code... the ULP program I have that uses adc1 to wake on hall sensor readings fails to execute. I'm guessing because of the way this function uses the ADC that perhaps there needs to be some kind of release or reset on the adc? The ULP loading code looks like this:
https://github.com/tinypico/tinypico-arduino/blob/3b364e65c4688f8dde0f598533fa035c6735ac71/TinyPICO-Helper/src/TinyPICO.cpp#L207-L230
I'm not familiar enough yet with how the adc is configured and used and reused, but in debugging my program I've found that if I call the GetBatteryVoltage() function anywhere in my code... the ULP program I have that uses adc1 to wake on hall sensor readings fails to execute. I'm guessing because of the way this function uses the ADC that perhaps there needs to be some kind of release or reset on the adc? The ULP loading code looks like this: