# HG changeset patch # User Daniel O'Connor # Date 1373203097 -34200 # Node ID cecb0506f4b810894cf2af38be1e7d177f41b9e2 # Parent 4c1db877452bcda3e4ba5bc2eb0ae25bafe56433 No point disabling IRQs inside the function calls since any pending IRQs happen when we return. The caller must do it. diff -r 4c1db877452b -r cecb0506f4b8 delay.c --- a/delay.c Tue Apr 23 20:46:37 2013 +0930 +++ b/delay.c Sun Jul 07 22:48:17 2013 +0930 @@ -10,8 +10,6 @@ uint32_t dly, cnt, clk_per_usec, max_dly; volatile uint32_t *DWT_CYCCNT = (uint32_t *)0xe0001004; - __disable_irq(); - #ifdef SYSCLK_FREQ_72MHz clk_per_usec = 72; max_dly = (1<<31) / clk_per_usec; /* Really half the maximum (still ~30 seconds at 72MHz) */ @@ -30,7 +28,5 @@ /* Wait until we get to the stop count */ while (*DWT_CYCCNT < dly) ; - - __enable_irq(); }