A process that writes large chunks of data to the embedded flash can
monopolize the CPU for a very long time if the flash is fast enough to
write data words.
This is bad from the real-time perspective, so make flash_wait() a
voluntary preemption point, also in the case when the flash is fast
enough and never goes in busy state.
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4771
38d2e660-2303-0410-9eaa-
f027e97ec537
ticks_t start = timer_clock();
while (true)
{
+ cpu_relax();
if (!(EMB_FLASH->SR & FLASH_FLAG_BSY))
break;
LOG_ERR("Timeout..\n");
return false;
}
-
- cpu_relax();
}
return true;