[riot-notifications] [RIOT-OS/RIOT] stm32_common/flash: move wait_for_pending_operation to flash_common (#11355)

Alexandre Abadie notifications at github.com
Wed Apr 10 20:54:31 CEST 2019


aabadie commented on this pull request.



> @@ -56,3 +57,23 @@ void _lock(void)
         CNTRL_REG |= CNTRL_REG_LOCK;
     }
 }
+
+void _wait_for_pending_operations(void)
+{
+    if ((FLASH->SR & FLASH_SR_BSY) == FLASH_SR_BSY) {
+        DEBUG("[flash-common] waiting for any pending operation to finish\n");
+        while (FLASH->SR & FLASH_SR_BSY) {}
+    }
+    else {

Comparing with master, the `else` block is an addition and it fails on stm32f1 which doesn't provide the `FLASH_SR_WRPERR` flag.
There are 2 possibilities:
- provide the flash error handling in a separate PR
- keep it, but put it in its own commit and fix the stm32f1 case.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11355#pullrequestreview-225156514
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190410/586cbe11/attachment-0001.html>


More information about the notifications mailing list