xx
This commit is contained in:
1 parent
541738319d
commit
83f6dde860
12 files changed
+68
-22
No files matched your search
@@ -583,6 +583,7 @@ CONFIG_PKG_LVGL_VER="v8.3.10"
|
|||||||
# CONFIG_PKG_USING_U8G2 is not set
|
# CONFIG_PKG_USING_U8G2 is not set
|
||||||
# end of u8g2: a monochrome graphic library
|
# end of u8g2: a monochrome graphic library
|
||||||
|
|
||||||
|
# CONFIG_PKG_USING_NES_SIMULATOR is not set
|
||||||
# CONFIG_PKG_USING_OPENMV is not set
|
# CONFIG_PKG_USING_OPENMV is not set
|
||||||
# CONFIG_PKG_USING_MUPDF is not set
|
# CONFIG_PKG_USING_MUPDF is not set
|
||||||
# CONFIG_PKG_USING_STEMWIN is not set
|
# CONFIG_PKG_USING_STEMWIN is not set
|
||||||
@@ -1162,6 +1163,7 @@ CONFIG_PKG_RS485_VER="v1.06"
|
|||||||
# 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_INS5T8025 is not set
|
||||||
|
# CONFIG_PKG_USING_ST7305 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
|
||||||
|
|
||||||
|
|||||||
@@ -1526,7 +1526,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="/828F" />
|
<resource resourceType="PROJECT" workspacePath="/project" />
|
||||||
</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>828F</name>
|
<name>project</name>
|
||||||
<comment />
|
<comment />
|
||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
|
|||||||
@@ -408,20 +408,20 @@ void pasre_DAT(const char *api, const char *json_str)
|
|||||||
}
|
}
|
||||||
else if (strcmp(api, "SC830") == 0)
|
else if (strcmp(api, "SC830") == 0)
|
||||||
{//当前信息
|
{//当前信息
|
||||||
cJSON_AddItemToObject(dat,"ERR",cJSON_CreateBool(MACHINE_ERR));
|
cJSON_AddItemToObject(dat,"ERR",cJSON_CreateNumber(MACHINE_ERR));
|
||||||
cJSON_AddItemToObject(dat,"LOCK",cJSON_CreateBool(MACHINE_LOCK));
|
cJSON_AddItemToObject(dat,"LOCK",cJSON_CreateNumber(MACHINE_LOCK));
|
||||||
cJSON_AddItemToObject(dat,"Status",cJSON_CreateString(Message));
|
cJSON_AddItemToObject(dat,"Status",cJSON_CreateString(Message));
|
||||||
cJSON_AddItemToObject(dat,"Work",cJSON_CreateString(Work));
|
cJSON_AddItemToObject(dat,"Work",cJSON_CreateString(Work));
|
||||||
cJSON_AddItemToObject(dat,"ReDye",cJSON_CreateNumber(Redye));
|
cJSON_AddItemToObject(dat,"ReDye",cJSON_CreateNumber(Redye));
|
||||||
cJSON_AddItemToObject(dat,"Process",cJSON_CreateString(Process));
|
cJSON_AddItemToObject(dat,"Process",cJSON_CreateString(Process));
|
||||||
cJSON_AddItemToObject(dat,"Step",cJSON_CreateString(Step));
|
cJSON_AddItemToObject(dat,"Step",cJSON_CreateString(Step));
|
||||||
cJSON_AddItemToObject(dat,"User",cJSON_CreateBool(MACHINE_USER));
|
cJSON_AddItemToObject(dat,"User",cJSON_CreateNumber(MACHINE_USER));
|
||||||
cJSON_AddItemToObject(dat,"UserB",cJSON_CreateString("False"));
|
cJSON_AddItemToObject(dat,"UserB",cJSON_CreateNumber(0));
|
||||||
cJSON_AddItemToObject(dat,"InfoS",cJSON_CreateNumber(UserInfoStart));
|
cJSON_AddItemToObject(dat,"InfoS",cJSON_CreateNumber(UserInfoStart));
|
||||||
cJSON_AddItemToObject(dat,"Info",cJSON_CreateString(Info));
|
cJSON_AddItemToObject(dat,"Info",cJSON_CreateString(Info));
|
||||||
cJSON_AddItemToObject(dat,"RUN",cJSON_CreateNumber(RUN));
|
cJSON_AddItemToObject(dat,"RUN",cJSON_CreateNumber(RUN));
|
||||||
cJSON_AddItemToObject(dat,"STEPID",cJSON_CreateNumber(STEPID));
|
cJSON_AddItemToObject(dat,"STEPID",cJSON_CreateNumber(STEPID));
|
||||||
cJSON_AddItemToObject(dat,"CALL",cJSON_CreateBool(MACHINE_CALL));
|
cJSON_AddItemToObject(dat,"CALL",cJSON_CreateNumber(MACHINE_CALL));
|
||||||
cJSON_AddItemToObject(dat,"MST",cJSON_CreateNumber(MST));
|
cJSON_AddItemToObject(dat,"MST",cJSON_CreateNumber(MST));
|
||||||
cJSON_AddItemToObject(dat,"MTT",cJSON_CreateNumber(MTT));
|
cJSON_AddItemToObject(dat,"MTT",cJSON_CreateNumber(MTT));
|
||||||
cJSON_AddItemToObject(dat,"MTL",cJSON_CreateNumber(MTL));
|
cJSON_AddItemToObject(dat,"MTL",cJSON_CreateNumber(MTL));
|
||||||
@@ -431,8 +431,6 @@ void pasre_DAT(const char *api, const char *json_str)
|
|||||||
cJSON_AddItemToObject(dat,"STLA",cJSON_CreateNumber(STLA));
|
cJSON_AddItemToObject(dat,"STLA",cJSON_CreateNumber(STLA));
|
||||||
cJSON_AddItemToObject(dat,"STTB",cJSON_CreateNumber(STTB));
|
cJSON_AddItemToObject(dat,"STTB",cJSON_CreateNumber(STTB));
|
||||||
cJSON_AddItemToObject(dat,"STLB",cJSON_CreateNumber(STLB));
|
cJSON_AddItemToObject(dat,"STLB",cJSON_CreateNumber(STLB));
|
||||||
cJSON_AddItemToObject(dat,"STTC",cJSON_CreateNumber(STTC));
|
|
||||||
cJSON_AddItemToObject(dat,"STLC",cJSON_CreateNumber(STLC));
|
|
||||||
}
|
}
|
||||||
else if (strcmp(api, "SC831") == 0)
|
else if (strcmp(api, "SC831") == 0)
|
||||||
{//当前步骤信息
|
{//当前步骤信息
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ char machine_name[16];
|
|||||||
char machine_ID[3];
|
char machine_ID[3];
|
||||||
|
|
||||||
// 状态标志
|
// 状态标志
|
||||||
char MACHINE_ERR = 0;
|
rt_bool_t MACHINE_ERR = 0;
|
||||||
char MACHINE_LOCK = 0;
|
rt_bool_t MACHINE_LOCK = 0;
|
||||||
char MACHINE_AUTO = 0;
|
rt_bool_t MACHINE_AUTO =0;
|
||||||
char MACHINE_CALL = 0;
|
rt_bool_t MACHINE_CALL = 0;
|
||||||
char MACHINE_USER = 0;
|
rt_bool_t MACHINE_USER = 0;
|
||||||
|
|
||||||
// 字符串变量(RAM 中可修改)
|
// 字符串变量(RAM 中可修改)
|
||||||
char Work[25]="SC----------";
|
char Work[25]="SC----------";
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ extern char machine_name[16];
|
|||||||
extern char machine_ID[3];
|
extern char machine_ID[3];
|
||||||
|
|
||||||
// ===== 布尔变量 =====
|
// ===== 布尔变量 =====
|
||||||
extern char MACHINE_ERR;
|
extern rt_bool_t MACHINE_ERR;
|
||||||
extern char MACHINE_LOCK;
|
extern rt_bool_t MACHINE_LOCK;
|
||||||
extern char MACHINE_AUTO;
|
extern rt_bool_t MACHINE_AUTO;
|
||||||
extern char MACHINE_CALL;
|
extern rt_bool_t MACHINE_CALL;
|
||||||
extern char MACHINE_USER;
|
extern rt_bool_t MACHINE_USER;
|
||||||
|
|
||||||
// ===== 字符串 =====
|
// ===== 字符串 =====
|
||||||
extern char Work[25];
|
extern char Work[25];
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ int qspi_fal(void)
|
|||||||
{
|
{
|
||||||
LOG_E("Format memory sysdata");
|
LOG_E("Format memory sysdata");
|
||||||
/* 格式化文件系统 */
|
/* 格式化文件系统 */
|
||||||
dfs_mkfs("lfs", "sysdata");
|
//dfs_mkfs("lfs", "sysdata");
|
||||||
/* 挂载 littlefs */
|
/* 挂载 littlefs */
|
||||||
if (dfs_mount("sysdata", "/sys", "lfs", 0, NULL) == RT_EOK)
|
if (dfs_mount("sysdata", "/sys", "lfs", 0, NULL) == RT_EOK)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include <dfs_posix.h>
|
#include <dfs_posix.h>
|
||||||
#include "DB_SQLite.h"
|
#include "DB_SQLite.h"
|
||||||
#include "sqlite3.h"
|
#include "sqlite3.h"
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
#define DB_NAME "/sddisk/SC828.db"
|
#define DB_NAME "/sddisk/SC828.db"
|
||||||
int db_HelperInit;
|
int db_HelperInit;
|
||||||
@@ -180,6 +181,10 @@ void close_db_immediately(void) {
|
|||||||
void db_sqlite_init_full(void)
|
void db_sqlite_init_full(void)
|
||||||
{
|
{
|
||||||
LOG_D("[DataBase] Init SQLite");
|
LOG_D("[DataBase] Init SQLite");
|
||||||
|
|
||||||
|
rt_uint8_t * ptr = rt_malloc(1024*4);
|
||||||
|
sqlite3_config(SQLITE_CONFIG_PAGECACHE, ptr, 4096, 1);
|
||||||
|
|
||||||
sqlite3_initialize();
|
sqlite3_initialize();
|
||||||
|
|
||||||
if (access(DB_NAME, F_OK) != 0)
|
if (access(DB_NAME, F_OK) != 0)
|
||||||
@@ -194,6 +199,9 @@ void db_sqlite_init_full(void)
|
|||||||
}
|
}
|
||||||
return; //
|
return; //
|
||||||
} else{
|
} else{
|
||||||
|
|
||||||
|
sqlite3_exec(g_db, "PRAGMA cache_size = 8;", 0, 0, 0);
|
||||||
|
|
||||||
if(sqlite3_exec(g_db,sql_upgrade_workorder_steps, 0, 0, 0)==0)
|
if(sqlite3_exec(g_db,sql_upgrade_workorder_steps, 0, 0, 0)==0)
|
||||||
{
|
{
|
||||||
LOG_D("[DataBASE]WorkorderSteps Created successfully ");
|
LOG_D("[DataBASE]WorkorderSteps Created successfully ");
|
||||||
@@ -339,7 +347,7 @@ static void db_sqlite(void *parameter) {
|
|||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
//限制缓存大小 (KB)
|
//限制缓存大小 (KB)
|
||||||
sqlite3_exec(g_db, "PRAGMA cache_size = 8;", 0, 0, 0);
|
//sqlite3_exec(g_db, "PRAGMA cache_size = 8;", 0, 0, 0);
|
||||||
//设置临时存储为文件模式 (节省内存)
|
//设置临时存储为文件模式 (节省内存)
|
||||||
//sqlite3_exec(g_db, "PRAGMA temp_store = FILE;", 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);
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ rt_weak void rt_hw_board_init()
|
|||||||
/* 允许未对齐访问(Cortex-M3/M4/M7 支持) */
|
/* 允许未对齐访问(Cortex-M3/M4/M7 支持) */
|
||||||
//SCB->CCR |= SCB_CCR_UNALIGN_TRP_Msk; // ← 默认是 1(禁止)
|
//SCB->CCR |= SCB_CCR_UNALIGN_TRP_Msk; // ← 默认是 1(禁止)
|
||||||
// 要允许,应该 CLEAR 这个位!
|
// 要允许,应该 CLEAR 这个位!
|
||||||
//SCB->CCR &= ~SCB_CCR_UNALIGN_TRP_Msk;
|
//SCB->CCR &= ~SCB_CCR_UNALIGN_TRP_Msk;
|
||||||
|
|
||||||
extern void hw_board_init(char *clock_src, int32_t clock_src_freq, int32_t clock_target_freq);
|
extern void hw_board_init(char *clock_src, int32_t clock_src_freq, int32_t clock_target_freq);
|
||||||
|
|
||||||
|
|||||||
@@ -41,4 +41,14 @@
|
|||||||
#define SQLITE_OS_RTTHREAD 1
|
#define SQLITE_OS_RTTHREAD 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef SQLITE_DISABLE_INTRINSIC
|
||||||
|
#define SQLITE_DISABLE_INTRINSIC 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SQLITE_BYTEORDER
|
||||||
|
#define SQLITE_BYTEORDER 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define SQLITE_OMIT_RBU 1
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -344,6 +344,7 @@ rt_err_t rt_memheap_init(struct rt_memheap *memheap,
|
|||||||
rt_err_t rt_memheap_detach(struct rt_memheap *heap);
|
rt_err_t rt_memheap_detach(struct rt_memheap *heap);
|
||||||
void *rt_memheap_alloc(struct rt_memheap *heap, rt_size_t size);
|
void *rt_memheap_alloc(struct rt_memheap *heap, rt_size_t size);
|
||||||
void *rt_memheap_realloc(struct rt_memheap *heap, void *ptr, rt_size_t newsize);
|
void *rt_memheap_realloc(struct rt_memheap *heap, void *ptr, rt_size_t newsize);
|
||||||
|
void *rt_memheap_calloc(struct rt_memheap *heap, rt_size_t count, rt_size_t size);
|
||||||
void rt_memheap_free(void *ptr);
|
void rt_memheap_free(void *ptr);
|
||||||
void rt_memheap_info(struct rt_memheap *heap,
|
void rt_memheap_info(struct rt_memheap *heap,
|
||||||
rt_size_t *total,
|
rt_size_t *total,
|
||||||
|
|||||||
@@ -585,6 +585,33 @@ void *rt_memheap_realloc(struct rt_memheap *heap, void *ptr, rt_size_t newsize)
|
|||||||
}
|
}
|
||||||
RTM_EXPORT(rt_memheap_realloc);
|
RTM_EXPORT(rt_memheap_realloc);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function will allocate a block of memory from the specified memheap,
|
||||||
|
* and initialize all bytes in the allocated block to zero.
|
||||||
|
*
|
||||||
|
* @param heap is a pointer to the memheap object from which to allocate memory.
|
||||||
|
*
|
||||||
|
* @param count is the number of elements to allocate.
|
||||||
|
*
|
||||||
|
* @param size is the size of each element.
|
||||||
|
*
|
||||||
|
* @return the allocated memory block address, or RT_NULL on failure.
|
||||||
|
*/
|
||||||
|
void *rt_memheap_calloc(struct rt_memheap *heap, rt_size_t count, rt_size_t size)
|
||||||
|
{
|
||||||
|
void *p;
|
||||||
|
|
||||||
|
/* allocate 'count' objects of size 'size' */
|
||||||
|
p = rt_memheap_alloc(heap,count * size);
|
||||||
|
/* zero the memory */
|
||||||
|
if (p)
|
||||||
|
{
|
||||||
|
rt_memset(p, 0, count * size);
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
RTM_EXPORT(rt_memheap_calloc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function will release the allocated memory block by
|
* @brief This function will release the allocated memory block by
|
||||||
* rt_malloc. The released memory block is taken back to system heap.
|
* rt_malloc. The released memory block is taken back to system heap.
|
||||||
|
|||||||
Reference in new issue
Block a user