Currently, there is no way in the existing squareWave() API function to tell it that you want the square wave/INT pin output to work when on battery backup.
You currently have to do it manually with something like this:
RTC.writeRTC(RTC_CONTROL, (RTC.readRTC(RTC_CONTROL) | _BV(BBSQW)));
While it works, it is a bit ugly.
Having it in the API would be a nice addition.
My suggestion would be to add a flag parameter to the squareWave() function that if true would set the BBSQW bit. And then in the header file set it to false if not specified.
This allows it to be backward compatible with existing code and yet provide the new functionality for those that want/need it.
Currently, there is no way in the existing squareWave() API function to tell it that you want the square wave/INT pin output to work when on battery backup.
You currently have to do it manually with something like this:
While it works, it is a bit ugly.
Having it in the API would be a nice addition.
My suggestion would be to add a flag parameter to the squareWave() function that if true would set the BBSQW bit. And then in the header file set it to false if not specified.
This allows it to be backward compatible with existing code and yet provide the new functionality for those that want/need it.