Commit Graph

10 Commits (22cfe5d38424c9d6806323bbb72c26915db5d768)

Author SHA1 Message Date
Andre LaFleur 22cfe5d384 Completely switch over to _rtc variable
* Doing this will make it easier to shuffle the logic in WatchyRTC to
  these other subclasses of AbstractRTC
* I think we may even want to collapse WatchyRTC completely into
  AbstractRTC, as the two resemble each other pretty close. We will
  see what sort of design we end up with in the meantime
2021-12-18 15:26:50 -07:00
Andre LaFleur 793ff8e61f Perform next step by pushing WatchyRTC to check in with other variables 2021-12-18 15:26:50 -07:00
Andre LaFleur 3a2974b997 Crossing the Rubicon
* We are now going to make _rtc a pointer, and use that
  process of polymorphism as part of the refactors. Again,
  I worry about memory management, but there does not seem
  to be a very clear way around this
2021-12-18 15:26:50 -07:00
Andre LaFleur 3ca79867b9 Rely on two types with if statements
* I worry about the simple constructors here though. I believe that
  causes things to be instantiated on the stack which is then blown
  away. That would mean that I would need to rely on the heap with
  the new keyword, but if I do that I will need to deallocate later.
* Digging into DS3232RTC, it looks like it has no deallocator, and I
  kind of suspect the same for Rtc_Pcf8563. Either way, we will want
  to ensure that we can delete those classes where we need to. I
  would hate to introduce a memory leak somewhere on something so
  small
2021-12-18 15:26:50 -07:00
Andre LaFleur b7800f0b21 Simplify init() a bit more 2021-12-18 15:26:50 -07:00
Andre LaFleur bac7b4eb51 Setup AbstractRTC, cleanup init(), and add some declarations 2021-12-18 15:26:50 -07:00
Andre LaFleur 715bbaf85d Begin RTC refactor
* My current understanding of the WatchyRTC class is that it came about
  due to the need to ship Watchys with new RTC chips. The class here is
  designed to accomodate both chips
* This class is a good way of doing just that--a single spot that
  hides the implementation details of both chips. The downside to this
  approach in the moment is that we have a bunch of conditionals that
  check if we have this or that chip, and if we ever need to support
  yet another chip, we will have an even more complex WatchyRTC class
* I am going to refactor this to simplify it so that way we will not
  have to worry about modifying this much if we need to support a new
  chip, or if someone else wants to support a new chip
2021-12-18 15:25:05 -07:00
sqfmi 57725d9793 fixed setting datetime 2021-12-18 15:20:32 -07:00
sqfmi ec26c84da2 fixed bugs and change temp. sensor 2021-12-18 15:20:32 -07:00
sqfmi 733c1abfb9 Fix RTC
- Added RTC scan
- Support for both RTCs in abstraction lib
2021-12-18 15:20:32 -07:00