停用QSPI_ELM

停用TMPFS_ELM
SD挂在到"/"根目录
数据库文件修改存储路径
配置文件修改存储路径
This commit is contained in:
sc committed 2026-02-24 19:31:52 +08:00
1 parent 5006477fc9
commit c3741e1888
7 files changed
+15 -12

No files matched your search

+3 -3
View File
@@ -12,7 +12,7 @@
#include "ini.h" #include "ini.h"
#include "Variable.h" #include "Variable.h"
#define INI_config "/sys/828config.ini" #define INI_config "/828config.ini"
#define DBG_TAG "INI.config" #define DBG_TAG "INI.config"
#define DBG_LVL DBG_LOG #define DBG_LVL DBG_LOG
@@ -74,7 +74,7 @@ int read_sample(void)
return -1; return -1;
} }
} }
LOG_I("read config"); LOG_D("read config");
// 读取各种类型的值 // 读取各种类型的值
strncpy(machine_ID, ini_get_value(ini, "CONFIG", "ID","99"),sizeof(machine_ID)); strncpy(machine_ID, ini_get_value(ini, "CONFIG", "ID","99"),sizeof(machine_ID));
strncpy(machine_name, ini_get_value(ini, "CONFIG", "NAME","SC828"),sizeof(machine_name)); strncpy(machine_name, ini_get_value(ini, "CONFIG", "NAME","SC828"),sizeof(machine_name));
@@ -83,4 +83,4 @@ int read_sample(void)
return 0; return 0;
} }
INIT_APP_EXPORT(read_sample); //INIT_APP_EXPORT(read_sample);
+1
View File
@@ -11,5 +11,6 @@
#define APPLICATIONS_INI_CONFIG_H_ #define APPLICATIONS_INI_CONFIG_H_
extern void write_sample(void); extern void write_sample(void);
extern int read_sample(void);
#endif /* APPLICATIONS_INI_CONFIG_H_ */ #endif /* APPLICATIONS_INI_CONFIG_H_ */
+2 -2
View File
@@ -96,7 +96,7 @@ int spi_flash_init(void)
LOG_I("MTD device 'sysdata' created."); LOG_I("MTD device 'sysdata' created.");
return RT_EOK; return RT_EOK;
} }
INIT_DEVICE_EXPORT(spi_flash_init); //INIT_DEVICE_EXPORT(spi_flash_init);
int qspi_fal(void) int qspi_fal(void)
{ {
@@ -125,4 +125,4 @@ int qspi_fal(void)
} }
return RT_EOK; return RT_EOK;
} }
INIT_COMPONENT_EXPORT(qspi_fal); //INIT_COMPONENT_EXPORT(qspi_fal);
+4 -4
View File
@@ -24,11 +24,11 @@ void sd_mount(void *parameter)
{ {
if (rt_device_find("sd") != RT_NULL) if (rt_device_find("sd") != RT_NULL)
{ {
LOG_I("Create file path /sddisk"); LOG_I("Create file path /disk");
mkdir("/sddisk", 0777); //mkdir("/sddisk", 0777);
if (dfs_mount("sd", "/sddisk", "elm", 0, NULL) == RT_EOK) if (dfs_mount("sd", "/", "elm", 0, NULL) == RT_EOK)
{ {
LOG_I("SD card mounted to '/sddisk' successfully"); LOG_I("SD card mounted to 'disk' successfully");
// 挂载成功,释放信号量 // 挂载成功,释放信号量
if (mount_sem != RT_NULL) if (mount_sem != RT_NULL)
{ {
+1 -1
View File
@@ -39,4 +39,4 @@ int init_tmpfs_root(void)
} }
/* 在应用初始化阶段运行(确保系统已就绪) */ /* 在应用初始化阶段运行(确保系统已就绪) */
INIT_DEVICE_EXPORT(init_tmpfs_root); //INIT_DEVICE_EXPORT(init_tmpfs_root);
+3 -1
View File
@@ -11,6 +11,7 @@
#include <rtthread.h> #include <rtthread.h>
#include <light/RUN_LED.h> #include <light/RUN_LED.h>
#include "DB_SQLite.h" #include "DB_SQLite.h"
#include "INI/config.h"
#include "Variable.h" #include "Variable.h"
#include "ltdc.h" #include "ltdc.h"
@@ -24,7 +25,8 @@ extern int wdt_sample();
int main(void) int main(void)
{ {
rt_sem_take(mount_sem, rt_tick_from_millisecond(5000)); // 等待挂载完成,最多等待 5 秒 rt_sem_take(mount_sem, rt_tick_from_millisecond(5000)); // 等待挂载完成,最多等待 5 秒
thread_DB_SQLite(); read_sample();//读配置文件
thread_DB_SQLite();//启动数据库
thread_RUN_LED();//运行指示灯线程 thread_RUN_LED();//运行指示灯线程
rt_snprintf(sys_var, sizeof(sys_var),"0.0.01a"); rt_snprintf(sys_var, sizeof(sys_var),"0.0.01a");
+1 -1
View File
@@ -16,7 +16,7 @@
#include <stdbool.h> #include <stdbool.h>
//#include "libcsv.h" //#include "libcsv.h"
#define DB_NAME "/sddisk/SC828.db" #define DB_NAME "/SC828.db"
int db_HelperInit; int db_HelperInit;
rt_mq_t db_mq = RT_NULL; // rt_mq_t db_mq = RT_NULL; //
struct db_command cmd; struct db_command cmd;