Microchip-MPLAB-Harmony / core

Harmony 3 Core
https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=MH3_core&redirect=true
Other
15 stars 12 forks source link

Fix propagation of error code in LITTLEFS_read()/LITTLEFS_write() #26

Open fwolter opened 2 years ago

fwolter commented 2 years ago

The comparison if (*bw < 0) in LITTLEFS_write(..) will always yield false, because *bw is an unsigned pointer. Same for the read function. This yields to SYS_FS_FileError(..) returning a no-error state when LITTLEFS_read()/LITTLEFS_write() have been failed.

This also fixes the missing mapping from the LittleFS error code to the Harmony error code in LITTLEFS_read().

vishalnxt commented 2 years ago

@fwolter , thank you for reporting the issue and suggesting the fix as well. This will be fixed in the next release of core.