Practice / Hardware & Robotics

Find the bugs in this interrupt code

Medium · Coding (typed)

Review this firmware and rewrite it correctly: int tick_count = 0; void SysTick_Handler(void) { // runs every 1 ms tick_count++; printf("tick %d\n", tick_count); } void delay_ms(int ms) { int start = tick_count; while (tick_count - start < ms) { } }

Create a free account to answer it and get scored on what a strong answer covers.