OPEnSLab-OSU / Loom

Arduino library for Internet of Things Rapid Prototyping in environmental sensing
GNU General Public License v3.0
26 stars 3 forks source link

Test Loom_PCF8523 #151

Closed rcpeene closed 2 years ago

rcpeene commented 3 years ago

Running the basic repeating PCF example in Loom with the config adjusted ('Interrupt_Manager' should be 'InterruptManager'). The code seems to halt and a featherfault is printed.

Fault! Cause: HARDFAULT Fault during recording: No Line: 36 File: PCF8523.cpp Failures since upload: 2

rcpeene commented 3 years ago

Testing with PCF customize time example yields the same fault and halting issue.

rcpeene commented 2 years ago

Testing in Loom version 2.5 has no such problem with functionally identical code.

rcpeene commented 2 years ago

I have narrowed down the point at which the code halts, to PCF8523.cpp, line 38. It appears to halt after line 38 successfully runs but before the function _begin() returns. I believe the traceback looks as follows (Most recent call last):

PCF8523::PCF8523() RTC::init() PCF8523::_begin()

rcpeene commented 2 years ago

The error was that PCF8523::_begin() was return type bool, yet the function contained no return statement. So the function could not be evaluated as a boolean where it was called in RTC::init(). Why this did not throw a compilation error or runtime error is beyond me. Adding a "return true;" to the end of _begin() seems to fix the issue.