[riot-notifications] [RIOT-OS/RIOT] sam0_common/periph/flashpage: fix unaligned write (#15707)

DanielLockau-MLPA notifications at github.com
Wed Jan 20 08:58:27 CET 2021


@DanielLockau-MLPA commented on this pull request.



> @@ -223,21 +230,25 @@ static void _write_page(void* dst, const void *data, size_t len, void (*cmd_writ
     _cmd_clear_page_buffer();
 
     /* write the first, unaligned bytes */
-    if (unaligned_start) {
-        *dst32++ = unaligned_pad_start(data, unaligned_start);
-        data = (uint8_t*)data + unaligned_start;
+    if (len_unaligned_start) {
+        *dst32++ = unaligned_pad_start(data, len_unaligned_start,
+                offset_unaligned_start);
+        data = (uint8_t*)data + len_unaligned_start;
     }
 
     /* copy whole words */
     const uint32_t *data32 = data;

And thanks for the review! I also found the original data32 pointer confusing but did not dare to change it.

-- 
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/15707#discussion_r560744471
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210119/e4d8d7f8/attachment.htm>


More information about the notifications mailing list