Fixed initialization and added a sleep in case there is no data to read from a device to avoid wasting cpu-time
Fixed compilation warninings
Fixed processing of task termintaion events
Added preemption-centric interrupt accounting for dedicated interrupt handling.