Update media driver status initialization FX_DRIVER_INIT request

Main Changes
------------
- In fx_media_format(), set fx_media_driver_status to FX_MEDIA_INVALID
  to indicate the request originates from a format call.

- In fx_media_open(), set fx_media_driver_status to FX_MEDIA_NOT_OPEN
   to indicate the request originates from an open call.

Fixed issues
-------------
-Issue #79

Signed-off-by: Haithem Rahmani <haithem.rahmani@st.com>
This commit is contained in:
Haithem Rahmani
2025-11-27 14:31:38 +01:00
parent 048a01ed64
commit 853f8a2431
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -161,9 +161,11 @@ UINT sectors_per_fat, f, s;
media_ptr -> fx_media_hidden_sectors = hidden_sectors; media_ptr -> fx_media_hidden_sectors = hidden_sectors;
/* Initialize the supplied media I/O driver. First, build the /* Initialize the supplied media I/O driver. First, build the
initialize driver request. */ initialize driver request. Set the fx_media_driver_status to FX_MEDIA_INVALID
to let the driver know that the request is issued from a fx_media_format() call
*/
media_ptr -> fx_media_driver_request = FX_DRIVER_INIT; media_ptr -> fx_media_driver_request = FX_DRIVER_INIT;
media_ptr -> fx_media_driver_status = FX_IO_ERROR; media_ptr -> fx_media_driver_status = FX_MEDIA_INVALID;
media_ptr -> fx_media_driver_info = driver_info_ptr; media_ptr -> fx_media_driver_info = driver_info_ptr;
media_ptr -> fx_media_driver_write_protect = FX_FALSE; media_ptr -> fx_media_driver_write_protect = FX_FALSE;
media_ptr -> fx_media_driver_free_sector_update = FX_FALSE; media_ptr -> fx_media_driver_free_sector_update = FX_FALSE;
+4 -2
View File
@@ -261,9 +261,11 @@ FX_INT_SAVE_AREA
FX_TRACE_IN_LINE_INSERT(FX_TRACE_MEDIA_OPEN, media_ptr, media_driver, memory_ptr, memory_size, FX_TRACE_MEDIA_EVENTS, 0, 0) FX_TRACE_IN_LINE_INSERT(FX_TRACE_MEDIA_OPEN, media_ptr, media_driver, memory_ptr, memory_size, FX_TRACE_MEDIA_EVENTS, 0, 0)
/* Initialize the supplied media I/O driver. First, build the /* Initialize the supplied media I/O driver. First, build the
initialize driver request. */ initialize driver request. Set the fx_media_driver_status to FX_MEDIA_NOT_OPEN
to let the driver understand that the request is issued from a fx_media_open() call.
*/
media_ptr -> fx_media_driver_request = FX_DRIVER_INIT; media_ptr -> fx_media_driver_request = FX_DRIVER_INIT;
media_ptr -> fx_media_driver_status = FX_IO_ERROR; media_ptr -> fx_media_driver_status = FX_MEDIA_NOT_OPEN;
media_ptr -> fx_media_driver_info = driver_info_ptr; media_ptr -> fx_media_driver_info = driver_info_ptr;
media_ptr -> fx_media_driver_write_protect = FX_FALSE; media_ptr -> fx_media_driver_write_protect = FX_FALSE;
media_ptr -> fx_media_driver_free_sector_update = FX_FALSE; media_ptr -> fx_media_driver_free_sector_update = FX_FALSE;