libDaisy icon indicating copy to clipboard operation
libDaisy copied to clipboard

Timer: DeInitialization expectations

Open stephenhensley opened this issue 3 years ago • 0 comments

This is likely the case with a few other peripherals as well, but I encountered it with the TimerHandle

When testing reusing TIM2 (which is used by System internally):

I attempted to call Init without anything first, this (somewhat expectedly) failed since the timer was running already.

So the next logical step was to call DeInit, before calling Init. This does not work because Init is what assigns the internal Impl class. So any calls prior to Init will fail.

So not necessarily a bug, but a whole in the expected functionality that should be addressed at some point throughout the library.

Should all Init functions do a full DeInit before Init to avoid the necessity?

stephenhensley avatar May 18 '22 15:05 stephenhensley