SEC: added cpu_relax() in busy-wait loop.
authorrasky <rasky@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 29 Sep 2010 12:32:42 +0000 (12:32 +0000)
committerrasky <rasky@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 29 Sep 2010 12:32:42 +0000 (12:32 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4341 38d2e660-2303-0410-9eaa-f027e97ec537

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);
 }