Commit Graph

3 Commits (d772ea7a009cac2a82f91561cf96071b13bcd346)

Author SHA1 Message Date
Christopher Haster 7c7d514000 Added callback null check for each template class
per @c1728p9 #131
2016-05-25 14:48:12 -05:00
Russ Butler e37e1da7b9 Update Callback to fix fault in serial interrupts
Update the Callback class to handle a NULL thunk by returning 0
rather than trying to call the thunk.  This fixes a crash that occurs
on some targets when the TX uart handler is not attached.

Background:
The K64F HAL uart implementation calls the TX interrupt handler
every time a uart interrupt occurs while the TX register is empty.
It does not check to see if the TX interrupt has been enabled.
This means that the TX interrupt can and typically does get
run on RX events.  This causes a crash with the newer callback
code which did not (prior to this patch) support a NULL thunk.
2016-05-24 17:18:11 -05:00
Christopher Haster 8e42a32d00 Add Callback, an improved FunctionPointer class
- Adopt C++11 style template arguments, requires rename to Callback
- Add constructor for C style callback functions
- Add constructor for Callbacks
- Add static function for passing to C style callbacks
2016-05-13 19:07:45 -05:00