Skip to content

Commit

Permalink
Merge branch 'beta' into beta-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ricki-z authored Mar 29, 2024
2 parents 741196e + 06d0e80 commit 3c1cce4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
18 changes: 9 additions & 9 deletions airrohr-firmware/Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ Additional Libraries needed for building:

## Source Layout

| Dateiname | Beschreibung |
| ----------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `airrohr-firmware.ino` | Sourcecode der eigentlichen Firmware |
| `ext_def.h` | grundsätzliche Konfiguration der Parameter (WLAN, Sensoren, APIs) |
| `html-content.h` | allgemeine HTML-Sourcen und Bilder für HTML- und Text-Ausgaben |
| `intl_xx.h` | Dateien mit übersetzten Texten für die Internationalisierung, 'xx' ist der 2 letter ISO code der 'Sprache' |
| `intl_template.h` | Vorlage für Übersetzungen |
| `astyle.rc` | Formatierungsvorlage für Astyle |
| `ppd42ns-wificonfig-ppd-sds-dht.spiffs.bin` | Binary mit leerem Dateisystem, zum Löschen der Konfiguration, siehe Anleitung im Wiki |
| File | Description |
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `airrohr-firmware.ino` | Source code of the actual firmware |
| `ext_def.h` | Basic configuration of the parameters (WLAN, sensors, APIs) |
| `html-content.h` | General HTML sources and images for HTML and text output |
| `intl_xx.h` | Files with translated texts for internationalization, 'xx' is the 2 letter ISO code of the 'language' |
| `intl_template.h` | Template for translations |
| `astyle.rc` | Formatting template for Astyle |
| `ppd42ns-wificonfig-ppd-sds-dht.spiffs.bin` | Binary with an empty file system, to delete the configuration, see the instructions in the wiki |


## Translations
Expand Down
9 changes: 8 additions & 1 deletion airrohr-firmware/airrohr-firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2866,7 +2866,14 @@ static void wifiConfig()

debug_outln_info(FPSTR(DBG_TXT_CONNECTING_TO), cfg::wlanssid);

WiFi.begin(cfg::wlanssid, cfg::wlanpwd);
if( *cfg::wlanpwd ) // non-empty password
{
WiFi.begin(cfg::wlanssid, cfg::wlanpwd);
}
else // empty password: WiFi AP without a password, e.g. "freifunk" or the like
{
WiFi.begin(cfg::wlanssid); // since somewhen, the espressif API changed semantics: no password need the 1 args call since.
}

debug_outln_info(F("---- Result Webconfig ----"));
debug_outln_info(F("WLANSSID: "), cfg::wlanssid);
Expand Down
9 changes: 8 additions & 1 deletion airrohr-firmware/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,16 @@ void add_Value2Json(String& res, const __FlashStringHelper* type, const __FlashS
float readCorrectionOffset(const char* correction) {
char* pEnd = nullptr;
// Avoiding atof() here as this adds a lot (~ 9kb) of code size
// which btw is really bad, because now we have a lot more work for everyone
// TODO: fix this mess to use fixed point
float r = float(strtol(correction, &pEnd, 10));
if (pEnd && pEnd[0] == '.' && pEnd[1] >= '0' && pEnd[1] <= '9') {
r += (r >= 0.0f ? 1.0f : -1.0f) * ((pEnd[1] - '0') / 10.0f);
bool isNegative = correction[0] == '-';
for (int i = 0; correction[i] == ' '; i++) {
isNegative = correction[i + 1] == '-';
}

r += (isNegative ? -1.0f : 1.0f) * ((pEnd[1] - '0') / 10.0f);
}
return r;
}
Expand Down

0 comments on commit 3c1cce4

Please sign in to comment.