[riot-notifications] [RIOT-OS/RIOT] mtd: fix mtd_write_page() across sector boundaries (#16848)

Francisco notifications at github.com
Tue Sep 21 10:16:00 CEST 2021


@fjmolinas commented on this pull request.



> +}
+
+int mtd_write_page(mtd_dev_t *mtd, const void *data, uint32_t page,
+                   uint32_t offset, uint32_t len)
+{
+    if (!mtd || !mtd->driver) {
+        return -ENODEV;
+    }
+
+    if (mtd->work_area == NULL) {
+        return mtd_write_page_raw(mtd, data, page, offset, len);
+    }
+
+    uint32_t sector = page / mtd->pages_per_sector;
+    const uint32_t sector_page = sector * mtd->pages_per_sector;
+    const char *_src = data;

Just nitpicking but why the underscor?

-- 
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/16848#pullrequestreview-759437500
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210921/1355c33a/attachment.htm>


More information about the notifications mailing list