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 4868635c4 tinyusb/msc_fat_view: Handle multi file write
4868635c4 is described below

commit 4868635c4084d9e054e871b30d96b552e9e69f69
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Tue Feb 11 11:20:24 2025 +0100

    tinyusb/msc_fat_view: Handle multi file write
    
    When new file that showed up in root directory was
    not referring to image file that was written to flash
    update handler was unregistered and further writes
    to root directory containing correct information
    about new image was not handled.
    
    Now writes to root that were not recognized don't
    remove image handler.
    
    This fixes case when user drops two files at once
    and only one is actual image.
    
    This was detected on Mac OS that probably
    wanted to created additional file when image file was
    dropped for upgrade.
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 hw/usb/tinyusb/msc_fat_view/src/update_handler.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/usb/tinyusb/msc_fat_view/src/update_handler.c 
b/hw/usb/tinyusb/msc_fat_view/src/update_handler.c
index 7512518a2..9f9829efc 100644
--- a/hw/usb/tinyusb/msc_fat_view/src/update_handler.c
+++ b/hw/usb/tinyusb/msc_fat_view/src/update_handler.c
@@ -208,6 +208,7 @@ image_file_written(struct msc_fat_view_write_handler 
*handler, uint32_t size,
             MSC_FAT_VIEW_LOG_ERROR(
                 "New file not ready to flash new sectors (%d-%d), (sector 
%d)\n",
                 unallocated_write.first_sector, unallocated_write.last_sector, 
sector);
+            return 0;
         }
     } else {
         if ((int)unallocated_write.write_status < 0) {

Reply via email to