SEC: added cpu_relax() in busy-wait loop.
[bertos.git] / bertos / sec / random_lm3s.c
index 0adc96cef7b9ebb1d438ba7e516780a270e449e7..b5945f461ea5fa89df8ebb734093068a8538d682 100644 (file)
@@ -36,6 +36,7 @@
  */
 
 #include "random_p.h"
+#include <cpu/power.h>
 #include <io/cm3.h>
 #include <drv/clock_lm3s.h>
 
@@ -47,7 +48,8 @@ INLINE uint16_t hw_readRawTemp(void)
     /* Trig the temperature sampling */
     HWREG(ADC0_BASE + ADC_O_PSSI) |= ADC_PSSI_SS3;
 
-       while (!(HWREG(ADC0_BASE + ADC_O_SSFSTAT3) & ADC_SSFSTAT3_FULL));
+       while (!(HWREG(ADC0_BASE + ADC_O_SSFSTAT3) & ADC_SSFSTAT3_FULL))
+               cpu_relax();
 
     return (uint16_t)HWREG(ADC0_BASE + ADC_O_SSFIFO3);
 }