Skip to content

Commit

Permalink
refactor the data structure
Browse files Browse the repository at this point in the history
  • Loading branch information
universam1 committed Oct 24, 2021
1 parent a20d94b commit 9d1e800
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 207 deletions.
46 changes: 23 additions & 23 deletions pio/lib/Globals/Globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
extern Ticker flasher;

// defines go here
#define FIRMWAREVERSION "7.1.3"
#define FIRMWAREVERSION "7.1.4"

#define API_FHEM true
#define API_UBIDOTS true
Expand Down Expand Up @@ -114,7 +114,7 @@ extern Ticker flasher;
// sleep management
#define RTCSLEEPADDR 5
#define MAXSLEEPTIME 3600UL //TODO
#define EMERGENCYSLEEP (myData.my_sleeptime * 3 < MAXSLEEPTIME ? MAXSLEEPTIME : myData.my_sleeptime * 3)
#define EMERGENCYSLEEP (myData.sleeptime * 3 < MAXSLEEPTIME ? MAXSLEEPTIME : myData.sleeptime * 3)
#define LOWBATT 3.3

#define UNINIT 0
Expand All @@ -133,28 +133,28 @@ String tempScaleLabel(uint8_t);

struct iData
{
char my_token[TKIDSIZE * 2];
char my_name[TKIDSIZE] = "iSpindel000";
char my_server[DNSSIZE];
char my_uri[DNSSIZE];
char my_db[TKIDSIZE] = "ispindel";
char my_username[TKIDSIZE];
char my_password[TKIDSIZE];
char my_job[TKIDSIZE] = "ispindel";
char my_instance[TKIDSIZE] = "000";
char my_polynominal[1000] = "-0.00031*tilt^2+0.557*tilt-14.054";
String my_ssid;
String my_psk;
uint8_t my_api;
uint32_t my_sleeptime = 15 * 60;
uint16_t my_port = 80;
uint32_t my_channel;
float my_vfact = ADCDIVISOR;
int16_t my_Offset[6];
uint8_t my_tempscale = TEMP_CELSIUS;
int8_t my_OWpin = -1;
char token[TKIDSIZE * 2];
char name[TKIDSIZE] = "iSpindel000";
char server[DNSSIZE];
char uri[DNSSIZE];
char db[TKIDSIZE] = "ispindel";
char username[TKIDSIZE];
char password[TKIDSIZE];
char job[TKIDSIZE] = "ispindel";
char instance[TKIDSIZE] = "000";
char polynominal[1000] = "-0.00031*tilt^2+0.557*tilt-14.054";
String ssid;
String psk;
uint8_t api;
uint32_t sleeptime = 15 * 60;
uint16_t port = 80;
uint32_t channel;
float vfact = ADCDIVISOR;
int16_t Offset[6];
uint8_t tempscale = TEMP_CELSIUS;
int8_t OWpin = -1;
#if API_MQTT_HASSIO
bool my_hassio = false;
bool hassio = false;
#endif
};

Expand Down
4 changes: 2 additions & 2 deletions pio/lib/WiFiManagerKT/WiFiManagerKT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,9 +986,9 @@ void WiFiManager::handleiSpindel()
page += Tilt;
page += F("&deg;</td></tr>");
page += F("<tr><td>Temperature:</td><td>");
page += scaleTemperatureFromC(Temperatur, myData.my_tempscale);
page += scaleTemperatureFromC(Temperatur, myData.tempscale);
page += F("&deg;");
page += tempScaleLabel(myData.my_tempscale);
page += tempScaleLabel(myData.tempscale);
page += F("</td></tr>");
page += F("<tr><td>Battery:</td><td>");
page += Volt;
Expand Down
Loading

0 comments on commit 9d1e800

Please sign in to comment.