内存与测试
This commit is contained in:
1 parent
efee86fab9
commit
4647022f6f
9 files changed
+36
-11
No files matched your search
@@ -207,7 +207,7 @@ CONFIG_RT_USING_SDIO=y
|
||||
CONFIG_RT_SDIO_STACK_SIZE=512
|
||||
CONFIG_RT_SDIO_THREAD_PRIORITY=15
|
||||
CONFIG_RT_MMCSD_STACK_SIZE=1024
|
||||
CONFIG_RT_MMCSD_THREAD_PREORITY=22
|
||||
CONFIG_RT_MMCSD_THREAD_PREORITY=19
|
||||
CONFIG_RT_MMCSD_MAX_PARTITION=16
|
||||
# CONFIG_RT_SDIO_DEBUG is not set
|
||||
CONFIG_RT_USING_SPI=y
|
||||
@@ -1151,6 +1151,7 @@ CONFIG_PKG_RS485_VER="v1.06"
|
||||
# CONFIG_PKG_USING_ST7789_SPI is not set
|
||||
# CONFIG_PKG_USING_ISOTP_C is not set
|
||||
# CONFIG_PKG_USING_IKUNLED is not set
|
||||
# CONFIG_PKG_USING_INS5T8025 is not set
|
||||
# CONFIG_PKG_USING_SPI_TOOLS is not set
|
||||
# end of peripheral libraries and drivers
|
||||
|
||||
|
||||
@@ -1076,7 +1076,7 @@
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders" />
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Debug">
|
||||
<resource resourceType="PROJECT" workspacePath="/project" />
|
||||
<resource resourceType="PROJECT" workspacePath="/828F" />
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>project</name>
|
||||
<name>828F</name>
|
||||
<comment />
|
||||
<projects>
|
||||
</projects>
|
||||
|
||||
Binary file not shown.
@@ -22,7 +22,7 @@ static struct rt_semaphore rx_sem;
|
||||
|
||||
#define RX_LINE_BUF_SIZE 1024
|
||||
#define RS485_SAMPLE_SLAVE_SERIAL "uart4"
|
||||
#define RS485_SAMPLE_SLAVE_BAUDRATE 57600
|
||||
#define RS485_SAMPLE_SLAVE_BAUDRATE 115200
|
||||
#define RS485_SAMPLE_MASTER_PARITY 0 //0 -- none parity
|
||||
#define RS485_SAMPLE_SLAVE_PIN -1 //-1 -- nonuse rs485 mode control
|
||||
#define RS485_SAMPLE_SLAVE_LVL 1
|
||||
|
||||
@@ -574,7 +574,7 @@ void proc_thread_entry(void *parameter)
|
||||
}
|
||||
}
|
||||
|
||||
extern struct rt_memheap sram_DTCMRAM;
|
||||
extern struct rt_memheap sdram_heap;
|
||||
static struct rt_thread dat_comm_thread;
|
||||
static void *dat_comm_stack __attribute__((aligned(4)))= RT_NULL ;
|
||||
int data_comm_init(void)
|
||||
@@ -587,7 +587,7 @@ int data_comm_init(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
dat_comm_stack = rt_memheap_alloc(&sram_DTCMRAM, 1024*6);
|
||||
dat_comm_stack = rt_memheap_alloc(&sdram_heap, 1024*6);
|
||||
dat_err = rt_thread_init(&dat_comm_thread, "dat_comm", proc_thread_entry, RT_NULL,dat_comm_stack, 1024*6, 15, 10);
|
||||
|
||||
if(dat_err != RT_EOK)
|
||||
|
||||
@@ -189,6 +189,10 @@ void db_sqlite_init_full(void)
|
||||
if (g_db)
|
||||
{
|
||||
sqlite3_close(g_db);
|
||||
//限制缓存大小 (100KB)
|
||||
sqlite3_exec(g_db, "PRAGMA cache_size = -50;", 0, 0, 0);
|
||||
//设置临时存储为文件模式 (节省内存)
|
||||
sqlite3_exec(g_db, "PRAGMA temp_store = FILE;", 0, 0, 0);
|
||||
g_db = RT_NULL;
|
||||
}
|
||||
return; //
|
||||
@@ -235,6 +239,10 @@ void db_sqlite_init_full(void)
|
||||
}else {
|
||||
if (sqlite3_open(DB_NAME, &g_db) == SQLITE_OK)
|
||||
{
|
||||
//限制缓存大小 (100KB)
|
||||
sqlite3_exec(g_db, "PRAGMA cache_size = -50;", 0, 0, 0);
|
||||
//设置临时存储为文件模式 (节省内存)
|
||||
sqlite3_exec(g_db, "PRAGMA temp_store = FILE;", 0, 0, 0);
|
||||
LOG_D("[DataBase] NAME (%s)",DB_NAME);
|
||||
}
|
||||
}
|
||||
@@ -312,6 +320,10 @@ static void db_sqlite(void *parameter) {
|
||||
return_disabled(&cmd);
|
||||
continue;
|
||||
} else {
|
||||
//限制缓存大小 (100KB)
|
||||
sqlite3_exec(g_db, "PRAGMA cache_size = -50;", 0, 0, 0);
|
||||
//设置临时存储为文件模式 (节省内存)
|
||||
sqlite3_exec(g_db, "PRAGMA temp_store = FILE;", 0, 0, 0);
|
||||
rt_kprintf("Opened database: %s\n", DB_NAME);
|
||||
}
|
||||
}
|
||||
@@ -399,16 +411,28 @@ rt_err_t db_send_command(enum db_cmd_type type, const char* sql, rt_int32_t time
|
||||
return result;
|
||||
}
|
||||
|
||||
extern struct rt_memheap sram_DTCMRAM;
|
||||
static struct rt_thread dat_sqlite_thread;
|
||||
static void *dat_sqlite_stack __attribute__((aligned(4)))= RT_NULL ;
|
||||
/* 线程 */
|
||||
void thread_DB_SQLite(void)
|
||||
{
|
||||
rt_thread_t tid;
|
||||
tid = rt_thread_create("db_sql", db_sqlite, RT_NULL, 1024 *16, 18, 10);
|
||||
rt_err_t db_err;
|
||||
dat_sqlite_stack = rt_memheap_alloc(&sram_DTCMRAM, 1024*16);
|
||||
db_err = rt_thread_init(&dat_sqlite_thread, "db_sql", db_sqlite, RT_NULL,dat_sqlite_stack, 1024*16, 15, 10);
|
||||
if(db_err != RT_EOK)
|
||||
{
|
||||
LOG_D("Failed to create SQLite thread!\n");
|
||||
}
|
||||
rt_thread_startup(&dat_sqlite_thread);
|
||||
|
||||
/* rt_thread_t tid;
|
||||
tid = rt_thread_create("db_sql", db_sqlite, RT_NULL, 1024 *14, 18, 10);
|
||||
|
||||
if (tid != RT_NULL)
|
||||
{
|
||||
rt_thread_startup(tid);
|
||||
}else{
|
||||
LOG_D("Failed to create SQLite thread!\n");
|
||||
}
|
||||
}*/
|
||||
}
|
||||
+1
-1
@@ -69,4 +69,4 @@ static int wdt_sample()
|
||||
return ret;
|
||||
}
|
||||
|
||||
//INIT_APP_EXPORT(wdt_sample);
|
||||
INIT_APP_EXPORT(wdt_sample);
|
||||
+1
-1
@@ -136,7 +136,7 @@
|
||||
#define RT_SDIO_STACK_SIZE 512
|
||||
#define RT_SDIO_THREAD_PRIORITY 15
|
||||
#define RT_MMCSD_STACK_SIZE 1024
|
||||
#define RT_MMCSD_THREAD_PREORITY 22
|
||||
#define RT_MMCSD_THREAD_PREORITY 19
|
||||
#define RT_MMCSD_MAX_PARTITION 16
|
||||
#define RT_USING_SPI
|
||||
#define RT_USING_QSPI
|
||||
|
||||
Reference in new issue
Block a user