[riot-notifications] [RIOT-OS/RIOT] stm32f{2, 4, 7}: Initial flashpage support (#15420)

benpicco notifications at github.com
Fri Nov 27 13:07:18 CET 2020


@benpicco commented on this pull request.



> +        return 16 * 1024;
+    }
+    else if (page == 4) {
+        return 64 * 1024;
+    }
+    else {
+        return 128 * 1024;
+    }
+}
+
+void *flashpage_addr(unsigned page)
+{
+    if (page == 0) {
+        return (void*)CPU_FLASH_BASE;
+    }
+    return (void*)((intptr_t)flashpage_addr(page - 1) + flashpage_size(page - 1));

We could have a generic 

```C
void *flashpage_addr(unsigned page)
{
    uintptr_t addr = 0;

    while (page) {
        addr += flashpage_size(--page);
    }

    return addr;
}
```

-- 
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/15420#discussion_r531564146
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201127/08460e63/attachment.htm>


More information about the notifications mailing list