conditional build of eeprom driver
This commit is contained in:
parent
775635019c
commit
b8f649b371
|
|
@ -121,8 +121,9 @@ esp_err_t ServiceDataHandler(data_message_t *MSG);
|
|||
sys_error_code SysVarsPayloadHandler(data_message_t *MSG);
|
||||
void GetSysErrorDetales(sys_error_code err, const char **br, const char **ds);
|
||||
|
||||
|
||||
#ifdef CONFIG_WEBGUIAPP_I2C_ENABLE
|
||||
esp_err_t eepr_i2c_read(uint16_t addr, uint8_t *data, int length);
|
||||
esp_err_t eepr_i2c_write(uint16_t addr, uint8_t *data, int length);
|
||||
#endif
|
||||
|
||||
#endif /* COMPONENTS_WEBGUIAPP_INCLUDE_SYSTEMAPPLICATION_H_ */
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@
|
|||
#include "esp_log.h"
|
||||
#include "esp_err.h"
|
||||
|
||||
#ifdef CONFIG_WEBGUIAPP_I2C_ENABLE
|
||||
|
||||
#define TAG "EEPROMDriver"
|
||||
|
||||
#define I2C_MASTER_TIMEOUT_MS 1000
|
||||
|
|
@ -149,3 +151,5 @@ esp_err_t eepr_i2c_write(uint16_t addr, uint8_t *data, int length)
|
|||
return ESP_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -317,7 +317,6 @@ static void funct_cronrecs(char *argres, int rw)
|
|||
}
|
||||
//CRON implementation END
|
||||
|
||||
|
||||
static void funct_serial_mode(char *argres, int rw)
|
||||
{
|
||||
|
||||
|
|
@ -336,8 +335,17 @@ static void funct_objsinfo(char *argres, int rw)
|
|||
|
||||
static void funct_exec(char *argres, int rw)
|
||||
{
|
||||
int len = strlen(argres);
|
||||
if (rw)
|
||||
ExecCommand(argres);
|
||||
{
|
||||
if ( argres[0] == '"' && argres[len - 1] == '"')
|
||||
{
|
||||
argres[len - 1] = 0x00;
|
||||
ExecCommand(argres + 1);
|
||||
}
|
||||
else
|
||||
snprintf(argres, VAR_MAX_VALUE_LENGTH, "\"ERROR_NOTASTRING\"");
|
||||
}
|
||||
else
|
||||
snprintf(argres, VAR_MAX_VALUE_LENGTH, "\"EXECUTED\"");
|
||||
}
|
||||
|
|
@ -374,7 +382,7 @@ static void funct_sd_block(char *argres, int rw)
|
|||
|
||||
static void funct_lat(char *argres, int rw)
|
||||
{
|
||||
if(rw)
|
||||
if (rw)
|
||||
{
|
||||
GetSysConf()->sntpClient.lat = atof(argres);
|
||||
}
|
||||
|
|
@ -383,7 +391,7 @@ static void funct_lat(char *argres, int rw)
|
|||
|
||||
static void funct_lon(char *argres, int rw)
|
||||
{
|
||||
if(rw)
|
||||
if (rw)
|
||||
{
|
||||
GetSysConf()->sntpClient.lon = atof(argres);
|
||||
}
|
||||
|
|
@ -529,7 +537,7 @@ const rest_var_t SystemVariables[] =
|
|||
{ 0, "gsm_dns2", &SysConfig.gsmSettings.DNSAddr2, VAR_IPADDR, RW, 0, 0 },
|
||||
{ 0, "gsm_dns3", &SysConfig.gsmSettings.DNSAddr3, VAR_IPADDR, RW, 0, 0 },
|
||||
{ 0, "gsm_stat", &funct_gsm_stat, VAR_FUNCT, R, 0, 0 },
|
||||
#ifdef CONFIG_WEBGUIAPP_MODEM_AT_ACCESS
|
||||
#ifdef CONFIG_WEBGUIAPP_MODEM_AT_ACCESS
|
||||
{ 0, "gsm_at_timeout", &funct_gsm_at_timeout, VAR_FUNCT, R, 0, 0 },
|
||||
{ 0, "gsm_at", &funct_gsm_at, VAR_FUNCT, R, 0, 0 },
|
||||
#endif
|
||||
|
|
@ -546,7 +554,7 @@ const rest_var_t SystemVariables[] =
|
|||
{ 0, "serial_baud", &SysConfig.serialSettings.BaudRate, VAR_INT, RW, 1200, 4096000 },
|
||||
{ 0, "serial_break", &SysConfig.serialSettings.InputBrake, VAR_INT, RW, 1, 50 },
|
||||
{ 0, "serial_visible", (bool*) (&VAR_TRUE), VAR_BOOL, R, 0, 1 },
|
||||
#else
|
||||
#else
|
||||
{ 0, "serial_visible", (bool*) (&VAR_FALSE), VAR_BOOL, R, 0, 1 },
|
||||
#endif
|
||||
|
||||
|
|
@ -580,7 +588,7 @@ const rest_var_t SystemVariables[] =
|
|||
{ 0, "sd_visible", (bool*) (&VAR_TRUE), VAR_BOOL, R, 0, 1 }
|
||||
#else
|
||||
{ 0, "sd_visible", (bool*) (&VAR_FALSE), VAR_BOOL, R, 0, 1 },
|
||||
#endif
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user