-
Notifications
You must be signed in to change notification settings - Fork 26
SD library issues #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Update/correct the modified SD library. In case of TFT bitmap logo example, File object is passed as an argument to R/W function but like File object is copied the current file pointer is reset so it is always read from the beginning. |
Using the TFT library TFTBitmapLogo example, SD file opened is passed to read function. If FIL is not a pointer (as it is copied thanks the copy constructor), file read/write pointer (fptr) is never incremented so always reading from beginning of the file. Fix stm32duino#1 Signed-off-by: Frederic Pillon <[email protected]>
Using the TFT library TFTBitmapLogo example, BMP file opened is passed to read16/32 functions. If 'FIL _fil' is not a pointer (as it is copied thanks the copy constructor), file read/write pointer (fptr) is never incremented so always reading from beginning of the file. Fix stm32duino#1 Signed-off-by: Frederic Pillon <[email protected]>
Hi @fpistm I was using this library together with STM32FreeRTOS and I was concerned by library code that makes use of I solved it by providing some hook functions for newlib to handle mutual exclusion and reentrancy problems ( I can prepare a PR for that if you want), but I was wondering if dynamic memory allocation was actually necessary here. What exactly was the issue with the previous version, with a member FIL structure? Can't we just provide a copy constructor? Or pass File objects by reference/pointer instead of by value? |
The issue was in some case the SDFile is passed to function which do some read. bmpfile is used several time and so always read from the beginning as the Fil was not dynamic. About the PR I'm always interested by improvement. Thanks in advance. |
From @fpistm on May 18, 2017 15:46
Link to SD lib need some correction.
Copied from original issue: stm32duino/Arduino_Core_STM32#2
The text was updated successfully, but these errors were encountered: