[riot-notifications] [RIOT-OS/RIOT] FIDO2 support in RIOT (#16489)

benpicco notifications at github.com
Mon Aug 23 23:29:47 CEST 2021


@benpicco commented on this pull request.



> +    if (_flash_is_erased(page, offset, len)) {
+        _flash_write_raw(page, offset, data, len);
+    }
+    else {
+        _flash_write(page, data, len);
+    }
+
+    return _flash_verify(page, offset, data, len);
+}
+
+static bool _flash_is_erased(int page, int offset, size_t len)
+{
+    uint32_t *addr = (uint32_t *)((uint8_t *)flashpage_addr(page) + offset);
+
+    for (size_t i = 0; i < len / 4; i++) {
+        if (addr[i] != 0xffffffff) {

STM32L0 and STM32L1 have a surprise for you. There the erase state of flash is zero.

Use `FLASHPAGE_ERASE_STATE`.

-- 
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/16489#pullrequestreview-736584519
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210823/d4323bfd/attachment-0001.htm>


More information about the notifications mailing list