Fix ESP400 out whith time zone

Add external config file option for SSID/Password
This commit is contained in:
Luc 2020-05-27 11:23:56 +02:00
parent 1dfe95f0a0
commit 26fef41f73
5 changed files with 11 additions and 3 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ embedded/dist
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/arduino.json
esp3d/myconfig.h

View File

@ -26,6 +26,13 @@
//Note: need both defined to enable it
//#define STATION_WIFI_SSID "*********"
//#define STATION_WIFI_PASSWORD "*********"
//you can also use a different config file for SSID/password
//this file is ignored by github
#if defined __has_include
# if __has_include ("myconfig.h")
# include "myconfig.h"
# endif
#endif
//SERIAL_COMMAND_FEATURE: allow to send command by serial
#define SERIAL_COMMAND_FEATURE

View File

@ -285,7 +285,7 @@ bool Commands::ESP400(const char* cmd_params, level_authenticate_type auth_type,
output->print ((int8_t)Settings_ESP3D::read_byte(ESP_TIMEZONE));
output->print("\",\"H\":\"tzone\",\"O\":[");
for (int8_t i = Settings_ESP3D::get_min_byte(ESP_TIMEZONE); i <= Settings_ESP3D::get_max_byte(ESP_TIMEZONE) ; i++) {
if (i > 1) {
if (i > Settings_ESP3D::get_min_byte(ESP_TIMEZONE)) {
output->print (",");
}
output->printf("{\"%d\":\"%d\"}", i, i);

View File

@ -533,7 +533,7 @@ uint8_t Settings_ESP3D::get_max_byte(int pos)
return res;
}
uint8_t Settings_ESP3D::get_min_byte(int pos)
int8_t Settings_ESP3D::get_min_byte(int pos)
{
uint8_t res;
switch(pos) {

View File

@ -114,7 +114,7 @@ public:
static uint32_t get_max_int32_value(int pos);
static uint32_t get_min_int32_value(int pos);
static uint8_t get_max_byte(int pos);
static uint8_t get_min_byte(int pos);
static int8_t get_min_byte(int pos);
static uint8_t read_byte (int pos, bool * haserror = NULL);
static uint32_t read_uint32(int pos, bool * haserror = NULL);
static uint32_t read_IP(int pos, bool * haserror = NULL);