Update mklfs to place data in qspi flash section

This commit is contained in:
L-diy
2023-11-13 13:36:23 +01:00
parent 81b7377f1b
commit 23020b159b

View File

@@ -1,7 +1,7 @@
/** /**
* @file main.c * @file main.c
* @brief Converts files to a C file that can be used by llfs (linked list file system). * @brief Converts files to a C file that can be used by llfs (linked list file system).
* @version 0.1.0 * @version 0.2.0
* @author Lorenz C. * @author Lorenz C.
*/ */
@@ -10,8 +10,8 @@
#include <string.h> #include <string.h>
#include "tinydir.h" #include "tinydir.h"
#define VERSION "0.1.0" #define VERSION "0.2.0"
#define LLFS_VERSION "0.1.0" #define LLFS_VERSION "0.1.1"
#define MAX_PATH_LEN 256 #define MAX_PATH_LEN 256
static void file_name_to_llfs_name(char* llfs_name, const char* file_name); static void file_name_to_llfs_name(char* llfs_name, const char* file_name);
@@ -99,6 +99,7 @@ int main(int argc, char** argv) {
// Write the file data to the output file // Write the file data to the output file
fprintf(out_file, "// File: %s\n", file.name); fprintf(out_file, "// File: %s\n", file.name);
fprintf(out_file, "__attribute__((section(\".ext_qspi_flash\")))\n");
fprintf(out_file, "const uint8_t %s_data[] = {\n", llfs_name); fprintf(out_file, "const uint8_t %s_data[] = {\n", llfs_name);
for (int i = 0, c; (c = fgetc(src_file)) != EOF; i++) { for (int i = 0, c; (c = fgetc(src_file)) != EOF; i++) {
file_size++; file_size++;