code refactor
fix bugs
code refactor
code refactor;
add intervalMap and IRQSwitch data structure