mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-15 06:28:14 +08:00
调试
This commit is contained in:
22
TC1/main.c
22
TC1/main.c
@@ -63,19 +63,19 @@ void recordDailyPCount() {
|
|||||||
// 判断上次检查的时间与当前时间的日期是否不同
|
// 判断上次检查的时间与当前时间的日期是否不同
|
||||||
if (last_check_day != 0) { tc1_log(
|
if (last_check_day != 0) { tc1_log(
|
||||||
"WARNGIN: last_check_time day %d ,current_time day %d", last_check_day,
|
"WARNGIN: last_check_time day %d ,current_time day %d", last_check_day,
|
||||||
current_time->tm_min);
|
current_time->tm_mday);
|
||||||
// 如果日期发生变化(即跨天了),则进行记录
|
// 如果日期发生变化(即跨天了),则进行记录
|
||||||
if (current_time->tm_min != last_check_day) {
|
if (current_time->tm_mday != last_check_day) {
|
||||||
|
|
||||||
tc1_log("WARNGIN: pcount day changed! ");
|
tc1_log("WARNGIN: pcount day changed! ");
|
||||||
// 记录数据
|
// 记录数据
|
||||||
// if (user_config->p_count_1_day_ago != 0) {
|
if (user_config->p_count_1_day_ago != 0) {
|
||||||
// user_config->p_count_2_days_ago = user_config->p_count_1_day_ago;
|
user_config->p_count_2_days_ago = user_config->p_count_1_day_ago;
|
||||||
// }
|
}
|
||||||
// user_config->p_count_1_day_ago = p_count;
|
user_config->p_count_1_day_ago = p_count;
|
||||||
//
|
|
||||||
// // 更新系统配置
|
// 更新系统配置
|
||||||
// mico_system_context_update(sys_config);
|
mico_system_context_update(sys_config);
|
||||||
|
|
||||||
tc1_log("WARNGIN: p_count record! p_count_1_day_ago:%d p_count_2_days_ago:%d",
|
tc1_log("WARNGIN: p_count record! p_count_1_day_ago:%d p_count_2_days_ago:%d",
|
||||||
user_config->p_count_1_day_ago, user_config->p_count_2_days_ago);
|
user_config->p_count_1_day_ago, user_config->p_count_2_days_ago);
|
||||||
@@ -83,7 +83,7 @@ void recordDailyPCount() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 更新上次检查时间
|
// 更新上次检查时间
|
||||||
last_check_day = current_time->tm_min;
|
last_check_day = current_time->tm_mday;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,8 +122,6 @@ int application_start(void) {
|
|||||||
err = mico_system_init(sys_config);
|
err = mico_system_init(sys_config);
|
||||||
require_noerr(err, exit);
|
require_noerr(err, exit);
|
||||||
|
|
||||||
p_count = user_config->p_count_1_day_ago;
|
|
||||||
|
|
||||||
uint8_t mac[8];
|
uint8_t mac[8];
|
||||||
mico_wlan_get_mac_address(mac);
|
mico_wlan_get_mac_address(mac);
|
||||||
sprintf(str_mac, "%02X%02X%02X%02X%02X%02X",
|
sprintf(str_mac, "%02X%02X%02X%02X%02X%02X",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "mqtt_server/user_mqtt_client.h"
|
#include "mqtt_server/user_mqtt_client.h"
|
||||||
#include "user_power.h"
|
#include "user_power.h"
|
||||||
|
|
||||||
uint32_t p_count = 0;
|
uint32_t p_count = user_config->p_count_1_day_ago;
|
||||||
PowerRecord power_record = { 1,{ 0 } };
|
PowerRecord power_record = { 1,{ 0 } };
|
||||||
char power_record_str[1101] = { 0 };
|
char power_record_str[1101] = { 0 };
|
||||||
float real_time_power = 0;
|
float real_time_power = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user