This commit is contained in:
e2002
2022-11-18 14:01:35 +03:00
parent ef14938dbe
commit 0bb4272d8b
13 changed files with 65 additions and 68 deletions

View File

@@ -129,7 +129,7 @@
<div class="flex-row credential">
<div class="inputwrap">
<span class="inputtitle">ssid</span>
<input type="text" id="ssid0" class="textinput" name="ssid" value="" maxlength="20" autocomplete="off" />
<input type="text" id="ssid0" class="textinput" name="ssid" value="" maxlength="30" autocomplete="off" />
</div>
<div class="inputwrap">
<span class="inputtitle">pass</span>
@@ -139,7 +139,7 @@
<div class="flex-row credential">
<div class="inputwrap">
<span class="inputtitle">ssid</span>
<input type="text" id="ssid1" class="textinput" name="ssid" maxlength="20" autocomplete="off" />
<input type="text" id="ssid1" class="textinput" name="ssid" maxlength="30" autocomplete="off" />
</div>
<div class="inputwrap">
<span class="inputtitle">pass</span>
@@ -149,7 +149,7 @@
<div class="flex-row credential">
<div class="inputwrap">
<span class="inputtitle">ssid</span>
<input type="text" id="ssid2" class="textinput" name="ssid" value="" maxlength="20" autocomplete="off" />
<input type="text" id="ssid2" class="textinput" name="ssid" value="" maxlength="30" autocomplete="off" />
</div>
<div class="inputwrap">
<span class="inputtitle">pass</span>
@@ -159,7 +159,7 @@
<div class="flex-row credential">
<div class="inputwrap">
<span class="inputtitle">ssid</span>
<input type="text" id="ssid3" class="textinput" name="ssid" value="" maxlength="20" autocomplete="off" />
<input type="text" id="ssid3" class="textinput" name="ssid" value="" maxlength="30" autocomplete="off" />
</div>
<div class="inputwrap">
<span class="inputtitle">pass</span>
@@ -169,7 +169,7 @@
<div class="flex-row credential">
<div class="inputwrap">
<span class="inputtitle">ssid</span>
<input type="text" id="ssid4" class="textinput" name="ssid" value="" maxlength="20" autocomplete="off" />
<input type="text" id="ssid4" class="textinput" name="ssid" value="" maxlength="30" autocomplete="off" />
</div>
<div class="inputwrap">
<span class="inputtitle">pass</span>

View File

@@ -434,8 +434,8 @@ bool Config::parseSsid(const char* line, char* ssid, char* pass) {
tmpe = strstr(line, "\t");
if (tmpe == NULL) return false;
uint16_t pos = tmpe - line;
if (pos > 19 || strlen(line) > 61) return false;
memset(ssid, 0, 20);
if (pos > 29 || strlen(line) > 71) return false;
memset(ssid, 0, 30);
strlcpy(ssid, line, pos + 1);
memset(pass, 0, 40);
strlcpy(pass, line + pos + 1, strlen(line) - pos);
@@ -467,11 +467,11 @@ bool Config::initNetwork() {
if (!file || file.isDirectory()) {
return false;
}
char ssidval[20], passval[40];
char ssidval[30], passval[40];
byte c = 0;
while (file.available()) {
if (parseSsid(file.readStringUntil('\n').c_str(), ssidval, passval)) {
strlcpy(ssids[c].ssid, ssidval, 20);
strlcpy(ssids[c].ssid, ssidval, 30);
strlcpy(ssids[c].password, passval, 40);
ssidsCount++;
c++;

View File

@@ -123,7 +123,7 @@ struct station_t
struct neworkItem
{
char ssid[20];
char ssid[30];
char password[40];
};

View File

@@ -1,7 +1,7 @@
#ifndef options_h
#define options_h
#define VERSION "0.8.03b"
#define VERSION "0.8.089"
/*******************************************************
DO NOT EDIT THIS FILE.
@@ -264,6 +264,9 @@ The connection tables are located here https://github.com/e2002/yoradio#connecti
#endif
#define AUTOBACKLIGHT(x) ({uint16_t _lh=(x>AUTOBACKLIGHT_MAX?AUTOBACKLIGHT_MAX:x); map(_lh, AUTOBACKLIGHT_MAX, 0, AUTOBACKLIGHT_MIN, 100);}) // autobacklight function
#endif
#ifndef DSP_INVERT_TITLE
#define DSP_INVERT_TITLE true // Invert title colors for OLED displays ?
#endif
/*
*** ST7735 display submodel ***
INITR_BLACKTAB // 1.8' https://aliexpress.ru/item/1005002822797745.html

View File

@@ -422,7 +422,7 @@ void Telnet::on_input(const char* str, byte clientId) {
printf(clientId, "##WIFI.STATION#\n> ");
return;
}
char newssid[20], newpass[40];
char newssid[30], newpass[40];
if (sscanf(str, "wifi.con(\"%[^\"]\",\"%[^\"]\")", newssid, newpass) == 2 || sscanf(str, "wifi.con(%[^,],%[^)])", newssid, newpass) == 2 || sscanf(str, "wifi.con(%[^ ] %[^)])", newssid, newpass) == 2 || sscanf(str, "wifi %[^ ] %s", newssid, newpass) == 2) {
char buf[BUFLEN];
snprintf(buf, BUFLEN, "New SSID: \"%s\" with PASS: \"%s\" for next boot\n> ", newssid, newpass);

View File

@@ -61,6 +61,9 @@ void DspCore::initDisplay() {
config.theme.buffer = TFT_FG;
config.theme.volbarout = TFT_FG;
config.theme.volbarin = TFT_FG;
config.theme.plcurrent = TFT_BG;
config.theme.plcurrentbg = TFT_FG;
config.theme.plcurrentfill = TFT_FG;
for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG;
setContrast(config.store.contrast);

View File

@@ -49,25 +49,7 @@ void DspCore::initDisplay() {
Serial.println(F("SH110X allocation failed"));
for (;;); // Don't proceed, loop forever
}
config.theme.background = TFT_BG;
config.theme.meta = TFT_BG;
config.theme.clock = TFT_FG;
config.theme.weather = TFT_FG;
config.theme.metabg = TFT_FG;
config.theme.metafill = TFT_FG;
config.theme.title1 = TFT_FG;
config.theme.title2 = TFT_FG;
config.theme.rssi = TFT_FG;
config.theme.ip = TFT_FG;
config.theme.vol = TFT_FG;
config.theme.bitrate = TFT_FG;
config.theme.digit = TFT_FG;
config.theme.buffer = TFT_FG;
config.theme.volbarout = TFT_FG;
config.theme.volbarin = TFT_FG;
for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG;
#include "tools/oledcolorfix.h"
cp437(true);
flip();
invert();

View File

@@ -53,24 +53,7 @@ void DspCore::initDisplay() {
Serial.println(F("SSD1305 allocation failed"));
for (;;); // Don't proceed, loop forever
}
config.theme.background = TFT_BG;
config.theme.meta = TFT_BG;
config.theme.clock = TFT_FG;
config.theme.weather = TFT_FG;
config.theme.metabg = TFT_FG;
config.theme.metafill = TFT_FG;
config.theme.title1 = TFT_FG;
config.theme.title2 = TFT_FG;
config.theme.rssi = TFT_FG;
config.theme.ip = TFT_FG;
config.theme.vol = TFT_FG;
config.theme.bitrate = TFT_FG;
config.theme.digit = TFT_FG;
config.theme.buffer = TFT_FG;
config.theme.volbarout = TFT_FG;
config.theme.volbarin = TFT_FG;
for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG;
#include "tools/oledcolorfix.h"
cp437(true);
flip();

View File

@@ -45,24 +45,7 @@ void DspCore::initDisplay() {
Serial.println(F("SSD1306 allocation failed"));
for (;;); // Don't proceed, loop forever
}
config.theme.background = TFT_BG;
config.theme.meta = TFT_BG;
config.theme.clock = TFT_FG;
config.theme.weather = TFT_FG;
config.theme.metabg = TFT_FG;
config.theme.metafill = TFT_FG;
config.theme.title1 = TFT_FG;
config.theme.title2 = TFT_FG;
config.theme.rssi = TFT_FG;
config.theme.ip = TFT_FG;
config.theme.vol = TFT_FG;
config.theme.bitrate = TFT_FG;
config.theme.digit = TFT_FG;
config.theme.buffer = TFT_FG;
config.theme.volbarout = TFT_FG;
config.theme.volbarin = TFT_FG;
for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG;
#include "tools/oledcolorfix.h"
cp437(true);
flip();
invert();

View File

@@ -0,0 +1,32 @@
#ifndef _OLEDCOLORFIX_H_
#define _OLEDCOLORFIX_H_
config.theme.background = TFT_BG;
#if DSP_INVERT_TITLE
config.theme.meta = TFT_BG;
config.theme.metabg = TFT_FG;
config.theme.metafill = TFT_FG;
#else
config.theme.meta = TFT_FG;
config.theme.metabg = TFT_BG;
config.theme.metafill = TFT_BG;
#endif
config.theme.clock = TFT_FG;
config.theme.weather = TFT_FG;
config.theme.title1 = TFT_FG;
config.theme.title2 = TFT_FG;
config.theme.rssi = TFT_FG;
config.theme.ip = TFT_FG;
config.theme.vol = TFT_FG;
config.theme.bitrate = TFT_FG;
config.theme.digit = TFT_FG;
config.theme.buffer = TFT_FG;
config.theme.volbarout = TFT_FG;
config.theme.volbarin = TFT_FG;
config.theme.plcurrent = TFT_BG;
config.theme.plcurrentbg = TFT_FG;
config.theme.plcurrentfill = TFT_FG;
for(byte i=0;i<5;i++) config.theme.playlist[i] = TFT_FG;
#endif

View File

@@ -376,7 +376,11 @@ void NumWidget::setText(const char* txt) {
strlcpy(_text, txt, _buffsize);
_getBounds();
if (strcmp(_oldtext, _text) == 0) return;
if (_active) dsp.fillRect(_oldleft == 0 ? _realLeft() : min(_oldleft, _realLeft()), _config.top-_textheight+1, max(_oldtextwidth, _textwidth), _textheight, _bgcolor);
uint16_t realth = _textheight;
#ifdef DSP_OLED
realth = _textheight*CHARHEIGHT;
#endif
if (_active) dsp.fillRect(_oldleft == 0 ? _realLeft() : min(_oldleft, _realLeft()), _config.top-_textheight+1, max(_oldtextwidth, _textwidth), realth, _bgcolor);
_oldtextwidth = _textwidth;
_oldleft = _realLeft();
if (_active) _draw();