去掉 打印float功能,减少内存占用

临时屏蔽set_cfg功能
添加updateAlarm测试函数
This commit is contained in:
CSSC-WORK\murmur 2023-08-23 11:02:26 +08:00
parent 65e31f8b46
commit ca4b8ee043
12 changed files with 32 additions and 33 deletions

10
.config
View File

@ -635,15 +635,7 @@ CONFIG_PKG_CJSON_VER="v1.7.15"
#
# CONFIG_PKG_USING_RT_MEMCPY_CM is not set
# CONFIG_PKG_USING_RT_KPRINTF_THREADSAFE is not set
CONFIG_PKG_USING_RT_VSNPRINTF_FULL=y
CONFIG_PKG_RT_VSNPRINTF_FULL_PATH="/packages/system/enhanced-kservice/rt_vsnprintf_full"
# CONFIG_RT_VSNPRINTF_FULL_REPLACING_SPRINTF is not set
# CONFIG_RT_VSNPRINTF_FULL_REPLACING_SNPRINTF is not set
# CONFIG_RT_VSNPRINTF_FULL_REPLACING_PRINTF is not set
# CONFIG_RT_VSNPRINTF_FULL_REPLACING_VSPRINTF is not set
# CONFIG_RT_VSNPRINTF_FULL_REPLACING_VSNPRINTF is not set
CONFIG_PKG_USING_RT_VSNPRINTF_FULL_LATEST_VERSION=y
CONFIG_PKG_RT_VSNPRINTF_FULL_VER="latest"
# CONFIG_PKG_USING_RT_VSNPRINTF_FULL is not set
# end of enhanced kernel services
#

View File

@ -1 +1,2 @@
--加密所有信息
setCommWindow 概率性崩溃,疑似与写入配置有关
setCommWindow 崩溃,疑似传参不对

View File

@ -85,7 +85,7 @@ static struct rt_alarm *alarm[4+1];//支持2组开窗共4个闹钟加一个
void InitAlarm()
{
struct rt_alarm_setup setup;
static time_t now;
time_t now;
struct tm p_tm;
/* 获取当前时间戳,并把下一秒时间设置为闹钟时间 */
now = time(NULL);
@ -162,7 +162,7 @@ void updateAlarm(uint8_t *t, size_t len)
// LOG_HEX("alarm",16,t,4);
struct rt_alarm_setup setup;
static time_t now;
time_t now;
struct tm p_tm;
/* 获取当前时间戳,并把下一秒时间设置为闹钟时间 */
now = time(NULL);

View File

@ -81,6 +81,7 @@ INIT_APP_EXPORT(iniUFMsg);
*/
int set_cfg(const char *k, long v)
{
return;
// setLock();
// if (rt_strcmp(v,"NULL") == 0) {//delete key
@ -447,6 +448,11 @@ void postFileInfo(const char *fin, uint8_t index)
rt_mq_send(&upfilelist, &msg, sizeof(msg));
}
/**
*
* @param k
* @return
*/
int updateLstFile(const char *fin)
{
nsetLock();
@ -462,7 +468,7 @@ int updateLstFile(const char *fin)
}
/**
*
*
* @param k
* @return
*/

View File

@ -25,8 +25,8 @@
#define MAX_KEY_LEN 60
#define SECTION_TO_SEND "tosend"
#define SECTION_LST_FILE "lstfile"
#define SECTION_TO_SEND "tosend"//待发送文件清单列表
#define SECTION_LST_FILE "lstfile"//最后缓存的文件名称
//typedef struct
//{

View File

@ -330,7 +330,7 @@ extern void updateAlarm(uint8_t *t, size_t len);
void setCommWindow(uint8_t *t, size_t len)
{
LOG_I("FUNC = setCommWindow");
LOG_HEX("new rtc",16,t,len);
//not working here
// char tmpstr[20];
@ -341,6 +341,14 @@ void setCommWindow(uint8_t *t, size_t len)
// LOG_D("updated new CommWindow zone");
}
void d_sw(void)
{
uint8_t cfg[]={0x03, 0x1F, 0x03, 0x20, 0x07, 0x1F, 0x09, 0x1E};
setCommWindow(cfg, 8);
}
/**
*
* @param t t=0
@ -1311,6 +1319,7 @@ MSH_CMD_EXPORT(d_getFileSize,d_getFileSize);
MSH_CMD_EXPORT(isEthUP,isEthUP);
MSH_CMD_EXPORT(reportSysCfg,reportSysCfg);
MSH_CMD_EXPORT(d_isInFence,d_isInFence);
MSH_CMD_EXPORT(d_sw,msw);
#endif

View File

@ -57,7 +57,7 @@ int main(void)
while (1)
while (0)
{
/* 拉低PIN脚 */
rt_pin_write(LED_HEART, PIN_LOW);

View File

@ -146,16 +146,12 @@ int mapParse(const char *fin,float *x, float *y)
LOG_D("%lf-%lf", x[var], y[var]);
rst = cnt;
}
// cJSON_Delete(llp);
}
}
}
// cJSON_Delete(sitem);
}
}
_exit:
// cJSON_Delete(object);
// cJSON_Delete(item);
cJSON_Delete(root);
rt_free(buffer);
return rst;
@ -214,7 +210,9 @@ static demo(int argc, char **argv)
float polyX[10]={},polyY[10]={};
int polyCorners = mapParse(f,polyX,polyY);
for (uint8_t var = 0; var < polyCorners; var++) {
LOG_I("%d=%lf,%lf",var+1,polyX[var],polyY[var]);
LOG_I("%d=%d.%d,%d.%d",var+1,
(int)polyX[var],(int)((long)(polyX[var]*1000000) % 1000000),
(int)polyY[var],(int)((long)(polyY[var]*1000000) % 1000000));
}
}
MSH_CMD_EXPORT_ALIAS(demo,d_parseFence,);

View File

@ -469,7 +469,7 @@ void recTT_thread_entry()
void recTT(void)
{
/* 创建线程 */
rt_thread_t thread = rt_thread_create("recTT", recTT_thread_entry, RT_NULL, 1024 * 5, 27, 10);
rt_thread_t thread = rt_thread_create("recTT", recTT_thread_entry, RT_NULL, 1024 * 6, 27, 10);
/* 创建成功则启动线程 */
if (thread != RT_NULL)
{

View File

@ -172,9 +172,9 @@ void phy_reset(void)
{
rt_pin_mode(ETH_RESET_PIN, PIN_MODE_OUTPUT);
rt_pin_write(ETH_RESET_PIN, PIN_HIGH);
rt_thread_mdelay(50);
rt_thread_mdelay(200);
rt_pin_write(ETH_RESET_PIN, PIN_LOW);
rt_thread_mdelay(50);
rt_thread_mdelay(200);
rt_pin_write(ETH_RESET_PIN, PIN_HIGH);
}

View File

@ -9,11 +9,6 @@
"ver": "v1.7.15",
"name": "CJSON"
},
{
"path": "/packages/system/enhanced-kservice/rt_vsnprintf_full",
"ver": "latest",
"name": "RT_VSNPRINTF_FULL"
},
{
"path": "/packages/system/syswatch",
"ver": "latest",

View File

@ -283,8 +283,6 @@
/* enhanced kernel services */
#define PKG_USING_RT_VSNPRINTF_FULL
#define PKG_USING_RT_VSNPRINTF_FULL_LATEST_VERSION
/* end of enhanced kernel services */
/* acceleration: Assembly language or algorithmic acceleration packages */
@ -346,7 +344,7 @@
/* end of miscellaneous packages */
/* Arduino libraries */
//#define BSP_USING_SDRAM
/* Projects */