SAM3/4: Loop counter for PLL delay must be volatile or it may get optimized away

This commit is contained in:
Gregory Nutt 2013-06-13 16:18:25 -06:00
parent 2bce348e0f
commit f7edd7a31c
1 changed files with 2 additions and 1 deletions

View File

@ -151,7 +151,8 @@ static inline void sam_supcsetup(void)
static void sam_pmcwait(uint32_t bit)
{
uint32_t delay;
volatile uint32_t delay;
for (delay = 0;
(getreg32(SAM_PMC_SR) & bit) == 0 && delay < UINT32_MAX;
delay++);