Replace hardcoded SPIFFS by Parameter #2068
Replies: 16 comments
-
What about the idea to use an #define in the User_Setup.h and do it like this:
And use the FILESYSTEM in all other files. |
Beta Was this translation helpful? Give feedback.
-
I use such an preprocessor define in my own spiffs function to select automatically the filesystem depending by the controller. |
Beta Was this translation helpful? Give feedback.
-
Hi,it's a handy way to use the filesystems :) , |
Beta Was this translation helpful? Give feedback.
-
@copyCATandpasteDOG |
Beta Was this translation helpful? Give feedback.
-
My fiels look like this:
And the cpp:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your help :) //------------------------------------------------------------------------ /**
#include <FS.h> // Name of the Touch calibration file // Define our filesystem // Set to tru if you want the calibration to run on each boot // Keypad start position, key sizes and spacing #define KEY_X (KEY_W/2) + KEY_SPACING_X // X-axis centre of the first key #define KEY_TEXTSIZE 3 // Font size multiplier // Choose the font you are using // Adding a delay between keypressing to give our OS time to respond // Create the screen object // Creating the labels for the buttons // Setting the colour for each button // Create 12 'keys' to use later void setup() { Serial.begin(115200); // Initialise the TFT screen // Set the rotation before we calibrate touch_calibrate(); // Clear the screen // Begin the Keyboard // Draw the keys ( 3 times 4 loops to create 12)
} } void loop() { uint16_t t_x = 0, t_y = 0; // To store the touch coordinates // Pressed will be set true is there is a valid touch on the screen // Check if any key coordinate boxes contain the touch coordinates // Check if any key has changed state
} } void buttonpress(int button) void touch_calibrate() // check file system exists // check if calibration file exists and size is correct if (calDataOK && !REPEAT_CAL) {
} //--------------------------------------------------------------------------------------- If you have a PICO around maybe you can try it and see if you have some compiling error |
Beta Was this translation helpful? Give feedback.
-
can you please strip your code to an minimal example! |
Beta Was this translation helpful? Give feedback.
-
My error comes from here: // Name of the Touch calibration file // Define our filesystem //--------------------------------------------- ResolveLibrary(FS.h) //-------------------------------------------------------- |
Beta Was this translation helpful? Give feedback.
-
Hi on the PI Pico I haven't actually no expirience. |
Beta Was this translation helpful? Give feedback.
-
That's sad,anyway, thanks for help :) |
Beta Was this translation helpful? Give feedback.
-
have you tried to comment the line: #include <FS.h> ? |
Beta Was this translation helpful? Give feedback.
-
You can't,it's the most importante part of the filesystem,if you comment it,it must be called in the littlefs.h or cpp and that |
Beta Was this translation helpful? Give feedback.
-
Got it working! |
Beta Was this translation helpful? Give feedback.
-
I do not understand the issue. If you are getting errors with the examples then please explain fully the errors and your setup. If you want to use SPIFFS for the font files then base the code on these examples which are in the SPIFFS examples submenu. If you want to use LittleFS for the font files then base the code on these examples which are in the LittleFS examples submenu. As far as I can see there is no need to add further complexity. |
Beta Was this translation helpful? Give feedback.
-
Hi I don't want to add not needed complexity. I just want to understand why in the In the Does this not conflict, when you load the |
Beta Was this translation helpful? Give feedback.
-
OK, I can see you did not understand my previous answers.
Please only raise issues for real problems with the library. Raise a pull request for inprovement suggestions and the discussions for general questions. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In the file
Smooth_font.h
there you will fin a hardcoded part with SPIFFS.See line 45ff.
Do I have to change here when I use the LittleFS?
And additionally in line 106.
Originally posted by @hasenradball in #2028 (comment)
Beta Was this translation helpful? Give feedback.
All reactions