内存与测试
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_STACK_SIZE=512
|
||||||
CONFIG_RT_SDIO_THREAD_PRIORITY=15
|
CONFIG_RT_SDIO_THREAD_PRIORITY=15
|
||||||
CONFIG_RT_MMCSD_STACK_SIZE=1024
|
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_MMCSD_MAX_PARTITION=16
|
||||||
# CONFIG_RT_SDIO_DEBUG is not set
|
# CONFIG_RT_SDIO_DEBUG is not set
|
||||||
CONFIG_RT_USING_SPI=y
|
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_ST7789_SPI is not set
|
||||||
# CONFIG_PKG_USING_ISOTP_C is not set
|
# CONFIG_PKG_USING_ISOTP_C is not set
|
||||||
# CONFIG_PKG_USING_IKUNLED 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
|
# CONFIG_PKG_USING_SPI_TOOLS is not set
|
||||||
# end of peripheral libraries and drivers
|
# end of peripheral libraries and drivers
|
||||||
|
|
||||||
|
|||||||
@@ -1076,7 +1076,7 @@
|
|||||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders" />
|
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders" />
|
||||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||||
<configuration configurationName="Debug">
|
<configuration configurationName="Debug">
|
||||||
<resource resourceType="PROJECT" workspacePath="/project" />
|
<resource resourceType="PROJECT" workspacePath="/828F" />
|
||||||
</configuration>
|
</configuration>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets" />
|
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets" />
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<projectDescription>
|
<projectDescription>
|
||||||
<name>project</name>
|
<name>828F</name>
|
||||||
<comment />
|
<comment />
|
||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
|
|||||||
Binary file not shown.
@@ -22,7 +22,7 @@ static struct rt_semaphore rx_sem;
|
|||||||
|
|
||||||
#define RX_LINE_BUF_SIZE 1024
|
#define RX_LINE_BUF_SIZE 1024
|
||||||
#define RS485_SAMPLE_SLAVE_SERIAL "uart4"
|
#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_MASTER_PARITY 0 //0 -- none parity
|
||||||
#define RS485_SAMPLE_SLAVE_PIN -1 //-1 -- nonuse rs485 mode control
|
#define RS485_SAMPLE_SLAVE_PIN -1 //-1 -- nonuse rs485 mode control
|
||||||
#define RS485_SAMPLE_SLAVE_LVL 1
|
#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 struct rt_thread dat_comm_thread;
|
||||||
static void *dat_comm_stack __attribute__((aligned(4)))= RT_NULL ;
|
static void *dat_comm_stack __attribute__((aligned(4)))= RT_NULL ;
|
||||||
int data_comm_init(void)
|
int data_comm_init(void)
|
||||||
@@ -587,7 +587,7 @@ int data_comm_init(void)
|
|||||||
return -1;
|
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);
|
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)
|
if(dat_err != RT_EOK)
|
||||||
|
|||||||
@@ -189,6 +189,10 @@ void db_sqlite_init_full(void)
|
|||||||
if (g_db)
|
if (g_db)
|
||||||
{
|
{
|
||||||
sqlite3_close(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;
|
g_db = RT_NULL;
|
||||||
}
|
}
|
||||||
return; //
|
return; //
|
||||||
@@ -235,6 +239,10 @@ void db_sqlite_init_full(void)
|
|||||||
}else {
|
}else {
|
||||||
if (sqlite3_open(DB_NAME, &g_db) == SQLITE_OK)
|
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);
|
LOG_D("[DataBase] NAME (%s)",DB_NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -312,6 +320,10 @@ static void db_sqlite(void *parameter) {
|
|||||||
return_disabled(&cmd);
|
return_disabled(&cmd);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} 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);
|
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;
|
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)
|
void thread_DB_SQLite(void)
|
||||||
{
|
{
|
||||||
rt_thread_t tid;
|
rt_err_t db_err;
|
||||||
tid = rt_thread_create("db_sql", db_sqlite, RT_NULL, 1024 *16, 18, 10);
|
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)
|
if (tid != RT_NULL)
|
||||||
{
|
{
|
||||||
rt_thread_startup(tid);
|
rt_thread_startup(tid);
|
||||||
}else{
|
}else{
|
||||||
LOG_D("Failed to create SQLite thread!\n");
|
LOG_D("Failed to create SQLite thread!\n");
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
+1
-1
@@ -69,4 +69,4 @@ static int wdt_sample()
|
|||||||
return ret;
|
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_STACK_SIZE 512
|
||||||
#define RT_SDIO_THREAD_PRIORITY 15
|
#define RT_SDIO_THREAD_PRIORITY 15
|
||||||
#define RT_MMCSD_STACK_SIZE 1024
|
#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_MMCSD_MAX_PARTITION 16
|
||||||
#define RT_USING_SPI
|
#define RT_USING_SPI
|
||||||
#define RT_USING_QSPI
|
#define RT_USING_QSPI
|
||||||
|
|||||||
Reference in new issue
Block a user