|
你好,请您帮我看一下机智云SoC esp8266这个结构数据如何实现读写操作。由于初学不懂操作格式,请您帮忙!
/** 用户区设备状态结构体*/
typedef_t struct {
bool valueLED_OnOff_0;
bool valueLED_OnOff_1;
bool valueLED_OnOff_2;
bool valueLED_OnOff_3;
bool valueTime_OnOff;
bool valueCountDown_OnOff;
uint32_t valueLED_Color;
uint32_t valueLED_R;
uint32_t valueLED_G;
uint32_t valueLED_B;
int32_t valueMotor_reversal;
uint32_t valueWeek_Repeat;
uint32_t valueMotor_is;
uint32_t valueTime_On_Minute;
uint32_t valueTime_Off_Minute;
uint32_t valueCountDown_Minute;
bool valueInfrared;
int32_t valueTemperature;
uint32_t valueHumidity;
uint32_t valuePower_Consumption;
uint32_t valuePower_Consumption1;
bool valueAlert_1;
bool valueAlert_2;
bool valueFault_LED;
bool valueFault_Motor;
bool valueFault_TemHum;
bool valueFault_IR;
} dataPoint_t;
/** 用户区当前设备状态结构体*/
extern dataPoint_t currentDataPoint;
读写地址
#define ESP_PARAM_START_SEC 0x3D
写设备状态结构体数据
system_param_save_with_protect(ESP_PARAM_START_SEC, ¤tDataPoint, sizeof(currentDataPoint));
读设备状态结构体数据
system_param_load(ESP_PARAM_START_SEC, 0, ¤tDataPoint, sizeof(currentDataPoint));
参照这个方法不成功,只要执行数据写入,程序就被破坏,必须重新烧写ESP8266。
|
|