Hi guys,
So my C++ library is going well, but I am now thinking about what to do about interrupts and timers.
Firstly due to the many different setups of timers, I am thinking of just keeping a .c file for each timer and then going there to setup the registers. Maybe a couple of functions timerX-init() and timerX_start() and timerX_stop then the header file with the prototypes wrapped in
extern "C" {...}
and then calling the functions from my C++ code when I need it, rather than trying to make a C++ class for each timer, and getting myself in a right mess.
For the external interrupts though and hardware timers CTC etc), as they also have the ISR's these aren't really "C" functions and dont have prototypes as such Im a little unsure as to how to keep them safe when being used with C++. They might not have a header file, - or atleast anything in it.
I only want the classes for code that isnt directly related to controlling the functionality of the microcontroller (and to learn).
Can people with a bit more experience give me some ideas please.
THanks