DEBUG("DFU: Boot (sp=%08x pc=%08x)\n", (uint) sp, (uint) pc);
#ifdef DEBUG_USART
- while (!usart_get_flag(DEBUG_USART, USART_FLAG_TC))
- ;
+ debug_flush();
#endif
debug_led(0);
asm volatile ("wfi");
}
+// A compiler memory barrier
+
+static inline void barrier(void)
+{
+ asm volatile ("" : : : "memory");
+}
+
// util-debug.c
void debug_printf(const char *fmt, ...) __attribute__((format(printf,1,2)));
void debug_puts(const char *s);
void debug_putc(int c);
+void debug_flush(void);
void debug_led(bool light);
void debug_led_toggle(void);