corrected HW delay function to have proper 1ms tick. corrected some static timeouts to better compensate,