modified tickless idle mode to be more generic
Using events instead of macros for low power entry and exit
updated tickless idle mode