Browse Source

0.5.99

fix limit in [User_Manual.md](../User_Manual.md)
changed `contrast` to `luminance` in `setup.html`
try to fix SSD1306 display #759
only show necessary display pins depending on setting
pull/769/head
lumapu 2 years ago
parent
commit
116a1e6a93
  1. 2
      User_Manual.md
  2. 8
      src/CHANGES.md
  3. 2
      src/app.cpp
  4. 2
      src/defines.h
  5. 4
      src/plugins/Display/Display.h
  6. 39
      src/web/html/setup.html
  7. 6
      src/web/web.h

2
User_Manual.md

@ -156,7 +156,7 @@ with a payload `[0 .. 65535]`
Example:
```mqtt
inverter/ctrl/limit_nonpersistent_absolute/0 600W
inverter/ctrl/limit/0 600W
```
### Power Limit persistent

8
src/CHANGES.md

@ -2,10 +2,16 @@
(starting from release version `0.5.66`)
## 0.5.99
* fix limit in [User_Manual.md](../User_Manual.md)
* changed `contrast` to `luminance` in `setup.html`
* try to fix SSD1306 display #759
* only show necessary display pins depending on setting
## 0.5.98
* fix SH1106 rotation and turn off during night #756
* removed MQTT subscription `sync_ntp`, `set_time` with a value of `0` does the same #696
* simplified MQTT subscription for `limit`. Check [User-Manual.md](../User-Manual.md) for new syntax #696, #713
* simplified MQTT subscription for `limit`. Check [User_Manual.md](../User_Manual.md) for new syntax #696, #713
* repaired inverter wise limit control
* fix upload settings #686

2
src/app.cpp

@ -78,7 +78,7 @@ void app::setup() {
// Plugins
if (mConfig->plugin.display.type != 0)
mDisplay.setup(&mConfig->plugin.display, &mSys, &mTimestamp, 0xff, mVersion);
mDisplay.setup(&mConfig->plugin.display, &mSys, &mTimestamp, mVersion);
mPubSerial.setup(mConfig, &mSys, &mTimestamp);

2
src/defines.h

@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 5
#define VERSION_PATCH 98
#define VERSION_PATCH 99
//-------------------------------------
typedef struct {

4
src/plugins/Display/Display.h

@ -14,7 +14,7 @@ class Display {
public:
Display() {}
void setup(display_t *cfg, HMSYSTEM *sys, uint32_t *utcTs, uint8_t disp_reset, const char *version) {
void setup(display_t *cfg, HMSYSTEM *sys, uint32_t *utcTs, const char *version) {
mCfg = cfg;
mSys = sys;
mUtcTs = utcTs;
@ -27,7 +27,7 @@ class Display {
if ((1 < mCfg->type) && (mCfg->type < 10)) {
mMono.config(mCfg->pwrSaveAtIvOffline, mCfg->pxShift, mCfg->contrast);
mMono.init(mCfg->type, mCfg->rot, mCfg->disp_cs, mCfg->disp_dc, mCfg->disp_reset, mCfg->disp_clk, mCfg->disp_data, mUtcTs, mVersion);
mMono.init(mCfg->type, mCfg->rot, mCfg->disp_cs, mCfg->disp_dc, 0xff, mCfg->disp_clk, mCfg->disp_data, mUtcTs, mVersion);
} else if (mCfg->type >= 10) {
#if defined(ESP32)
mRefreshCycle = 0;

39
src/web/html/setup.html

@ -265,11 +265,11 @@
<div class="col-4 col-sm-9"><input type="checkbox" name="disp_pwr"/></div>
</div>
<div class="row mb-3">
<div class="col-8 col-sm-3">Enable Screensaver (pixel shifting)</div>
<div class="col-8 col-sm-3">Enable Screensaver (pixel shifting, OLED only)</div>
<div class="col-4 col-sm-9"><input type="checkbox" name="disp_pxshift"/></div>
</div>
<div class="row mb-3">
<div class="col-12 col-sm-3 my-2">Contrast</div>
<div class="col-12 col-sm-3 my-2">Luminance</div>
<div class="col-12 col-sm-9"><input type="number" name="disp_cont" min="1" max="100"></select></div>
</div>
<p class="des">Pinout</p>
@ -647,12 +647,12 @@
document.getElementsByName(i)[0].checked = obj[i];
var e = document.getElementById("dispPins");
pins = [['clock', 'disp_clk'], ['data', 'disp_data'], ['cs', 'disp_cs'], ['dc', 'disp_dc'], ['reset', 'disp_rst'], ['busy', 'disp_bsy']];
var pins = [['clock', 'disp_clk'], ['data', 'disp_data'], ['cs', 'disp_cs'], ['dc', 'disp_dc'], ['reset', 'disp_rst']];
if("ESP32" == type)
pins.push(['busy', 'disp_bsy']);
for(p of pins) {
if(("ESP8266" == type) && p[0] == "busy")
break;
e.append(
ml("div", {class: "row mb-3"}, [
ml("div", {class: "row mb-3", id: "row_" + p[1]}, [
ml("div", {class: "col-12 col-sm-3 my-2"}, p[0].toUpperCase()),
ml("div", {class: "col-12 col-sm-9"},
sel(p[1], ("ESP8266" == type) ? esp8266pins : esp32pins, obj[p[1]])
@ -664,12 +664,16 @@
var opts = [[0, "None"], [1, "SSD1306 0.96\""], [2, "SH1106 1.3\""], [3, "Nokia5110"]];
if("ESP32" == type)
opts.push([10, "ePaper"]);
var dispType = sel("disp_typ", opts, obj["disp_typ"]);
document.getElementById("dispType").append(
ml("div", {class: "row mb-3"}, [
ml("div", {class: "col-12 col-sm-3 my-2"}, "Type"),
ml("div", {class: "col-12 col-sm-9"}, sel("disp_typ", opts, obj["disp_typ"]))
ml("div", {class: "col-12 col-sm-9"}, dispType)
])
);
dispType.addEventListener('change', (e) => {
hideDispPins(pins, e.target.value)
});
opts = [[0, "0&deg;"], [2, "180&deg;"]];
if("ESP32" == type) {
@ -684,6 +688,27 @@
);
document.getElementsByName("disp_cont")[0].value = obj["disp_cont"];
hideDispPins(pins, obj.disp_typ);
}
function hideDispPins(pins, dispType) {
if(0 == dispType) {
for(p of pins) {
document.getElementById("row_" + p[1]).classList.add("hide");
}
} else if(2 >= dispType) {
for(var i = 0; i < pins.length; i++) {
var cl = document.getElementById("row_" + pins[i][1]).classList;
if(i < 2)
cl.remove("hide");
else
cl.add("hide");
}
} else {
for(p of pins) {
document.getElementById("row_" + p[1]).classList.remove("hide");
}
}
}
function parse(root) {

6
src/web/web.h

@ -587,9 +587,9 @@ class Web {
mConfig->plugin.display.contrast = (mConfig->plugin.display.type == 0) ? 60 : request->arg("disp_cont").toInt();
mConfig->plugin.display.disp_data = (mConfig->plugin.display.type == 0) ? DEF_PIN_OFF : request->arg("disp_data").toInt();
mConfig->plugin.display.disp_clk = (mConfig->plugin.display.type == 0) ? DEF_PIN_OFF : request->arg("disp_clk").toInt();
mConfig->plugin.display.disp_cs = (mConfig->plugin.display.type < 3) ? DEF_PIN_OFF : request->arg("disp_cs").toInt();
mConfig->plugin.display.disp_reset = (mConfig->plugin.display.type < 3) ? DEF_PIN_OFF : request->arg("disp_rst").toInt();
mConfig->plugin.display.disp_dc = (mConfig->plugin.display.type < 3) ? DEF_PIN_OFF : request->arg("disp_dc").toInt();
mConfig->plugin.display.disp_cs = (mConfig->plugin.display.type < 4) ? DEF_PIN_OFF : request->arg("disp_cs").toInt();
mConfig->plugin.display.disp_reset = (mConfig->plugin.display.type < 4) ? DEF_PIN_OFF : request->arg("disp_rst").toInt();
mConfig->plugin.display.disp_dc = (mConfig->plugin.display.type < 4) ? DEF_PIN_OFF : request->arg("disp_dc").toInt();
mConfig->plugin.display.disp_busy = (mConfig->plugin.display.type < 10) ? DEF_PIN_OFF : request->arg("disp_bsy").toInt();
mApp->saveSettings((request->arg("reboot") == "on"));

Loading…
Cancel
Save