Skip to content

Commit

Permalink
Cosmetic cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dkerr64 authored and jgstroud committed Mar 25, 2024
1 parent fa1bfa2 commit 9512756
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ char *read_string_from_file(const char *filename, const char *defaultValue, char
{
RINFO("%s doesn't exist. creating...", filename);
strlcpy(buffer, defaultValue, bufsize);
write_string_to_file(filename, defaultValue);
write_string_to_file(filename, buffer);
}
else
{
Expand Down
1 change: 1 addition & 0 deletions src/web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ uint32_t rebootSeconds; // seconds between reboots
const char system_reboot_timer[] = "system_reboot_timer";
uint32_t min_heap = 0xffffffff;

// Control WiFi physical layer mode
WiFiPhyMode_t wifiPhyMode = (WiFiPhyMode_t)0;
extern "C" const char wifiPhyModeFile[] = "wifiPhyMode";
extern "C" const char wifiSettingsChangedFile[] = "wifiSettingsChanged";
Expand Down
8 changes: 4 additions & 4 deletions src/wifi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ void wifi_connect() {
}
wifiPhyMode = (WiFiPhyMode_t)read_int_from_file(wifiPhyModeFile);
if (wifiPhyMode == WIFI_PHY_MODE_11B) {
RINFO("Forcing WiFi to 802.11b (Wi-Fi 1)");
RINFO("Setting WiFi preference to 802.11b (Wi-Fi 1)");
}
else if (wifiPhyMode == WIFI_PHY_MODE_11G) {
RINFO("Forcing WiFi to 802.11g (Wi-Fi 3)");
RINFO("Setting WiFi preference to 802.11g (Wi-Fi 3)");
}
else if (wifiPhyMode == WIFI_PHY_MODE_11N) {
RINFO("Forcing WiFi to 802.11n (Wi-Fi 4)");
RINFO("Setting WiFi preference to 802.11n (Wi-Fi 4)");
}
else {
RINFO("WiFi physical layer selected automatically");
RINFO("Setting WiFi version preference to automatic");
}
WiFi.setPhyMode(wifiPhyMode);
WiFi.setAutoReconnect(true); // don't require explicit attempts to reconnect in the main loop
Expand Down
9 changes: 2 additions & 7 deletions src/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,18 @@
<td style="text-align: right;">Require Password:</td>
<td>&nbsp;
<input type="checkbox" id="pwreq" name="pwreq" value="no">
<span style="font-size: 0.6em;">(default: admin/password)</span>
<span style="font-size: 0.8em;">(default: admin/password)</span>
</td>
</tr>
<tr>
<td style="text-align: right;">Reboot Every:</td>
<td>&nbsp;
<input type="number" id="reboothours" name="reboothours" value="24" , min="0" , max="72" , step="1">
<label for="reboothours">Hours <span style="font-size: 0.6em;">(never:0, min:1, max:72)</span></label>
Hours <span style="font-size: 0.8em;">(never:0, min:1, max:72)</span>
</td>
</tr>
<tr>
<td style="text-align: right;">WiFi Version:</td>

<td>&nbsp;
<input type="radio" id="wifiphymode0" name="wifiphymode" value="0">
<label for="wifiphymode0">Auto</label>
Expand All @@ -201,10 +200,6 @@
<label for="wifiphymode2">802.11g</label>
<input type="radio" id="wifiphymode3" name="wifiphymode" value="3">
<label for="wifiphymode3">802.11n</label>
<!--
<input type="checkbox" id="wifiphymode" name="wifiphymode" value="no">
<label for="wifiphymode">802.11g</label>
-->
</td>
</tr>
<tr>
Expand Down

0 comments on commit 9512756

Please sign in to comment.