This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 540aa34b0 tinyusb/msc_fat_view: Fix constnes of link table entries
540aa34b0 is described below

commit 540aa34b04fc0ffec1f7e23f187a5a2b76bb3b67
Author: Jerzy Kasenberg <jerzy.kasenb...@codecoup.pl>
AuthorDate: Wed Jun 26 00:49:17 2024 +0200

    tinyusb/msc_fat_view: Fix constnes of link table entries
    
    qualifier const was incorrectly added to what pointed value
    instead of pointer itself.
    Pointer should go to section that is put in flash.
    For PIC32 this non-constant pointers were put in
    wrong state as if they in RAM (although addresses were in flash)
    and init code tried to initialize them resulting in
    access violation.
    
    Signed-off-by: Jerzy Kasenberg <je...@apache.org>
---
 hw/usb/tinyusb/msc_fat_view/include/msc_fat_view/msc_fat_view.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/usb/tinyusb/msc_fat_view/include/msc_fat_view/msc_fat_view.h 
b/hw/usb/tinyusb/msc_fat_view/include/msc_fat_view/msc_fat_view.h
index 3895467b4..88aaa7af3 100644
--- a/hw/usb/tinyusb/msc_fat_view/include/msc_fat_view/msc_fat_view.h
+++ b/hw/usb/tinyusb/msc_fat_view/include/msc_fat_view/msc_fat_view.h
@@ -108,7 +108,7 @@ void msc_fat_view_media_insert(void);
         .delete_entry = delete_fun,                \
         .valid = valid_fun,                        \
     };                                             \
-    const file_entry_t *entry ## _ptr ROOT_DIR_SECTION = &entry;
+    file_entry_t *const entry ## _ptr ROOT_DIR_SECTION = &entry;
 
 /**
  * Macro to add static write handlers
@@ -118,7 +118,7 @@ void msc_fat_view_media_insert(void);
         .write_sector = _write_sector,                          \
         .file_written = _file_written,                          \
     };                                                          \
-    const msc_fat_view_write_handler_t *entry ## _ptr WRITE_HANDLER_SECTION = 
&entry;
+    msc_fat_view_write_handler_t *const entry ## _ptr WRITE_HANDLER_SECTION = 
&entry;
 
 #define TABLE_START(table) __ ## table ## _start__
 #define TABLE_END(table) __ ## table ## _end__

Reply via email to