Test Loom_PCF8523
Closed this issue · 4 comments
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
Testing with PCF customize time example yields the same fault and halting issue.
Testing in Loom version 2.5 has no such problem with functionally identical code.
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()
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.