mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 10:46:31 +00:00
Fix some display issues
- Fix LCD line and column positioning (#7387) - Fix Display handling of hexadecimal escape characters (#7387)
This commit is contained in:
parent
b05301b149
commit
287b3b97f1
@ -58,6 +58,8 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
|
|||||||
- Fix Sonoff Bridge, Sc, L1, iFan03 and CSE7766 serial interface to forced speed, config and disable logging
|
- Fix Sonoff Bridge, Sc, L1, iFan03 and CSE7766 serial interface to forced speed, config and disable logging
|
||||||
- Fix commands ``Display`` and ``Counter`` from overruling command processing (#7322)
|
- Fix commands ``Display`` and ``Counter`` from overruling command processing (#7322)
|
||||||
- Fix ``White`` added to light status (#7142)
|
- Fix ``White`` added to light status (#7142)
|
||||||
|
- Fix LCD line and column positioning (#7387)
|
||||||
|
- Fix Display handling of hexadecimal escape characters (#7387)
|
||||||
- Add command ``SetOption79 0/1`` to enable reset of counters at teleperiod time by Andre Thomas (#7355)
|
- Add command ``SetOption79 0/1`` to enable reset of counters at teleperiod time by Andre Thomas (#7355)
|
||||||
- Add SerialConfig to ``Status 1``
|
- Add SerialConfig to ``Status 1``
|
||||||
- Add WifiPower to ``Status 5``
|
- Add WifiPower to ``Status 5``
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
### 8.1.0.2 20191230
|
### 8.1.0.2 20191230
|
||||||
|
|
||||||
- Add support for ``AdcParam`` parameters to control ADC0 Current Transformer Apparent Power formula by Jodi Dillon (#7100)
|
- Add support for ``AdcParam`` parameters to control ADC0 Current Transformer Apparent Power formula by Jodi Dillon (#7100)
|
||||||
|
- Fix LCD line and column positioning (#7387)
|
||||||
|
- Fix Display handling of hexadecimal escape characters (#7387)
|
||||||
|
|
||||||
### 8.1.0.1 20191225
|
### 8.1.0.1 20191225
|
||||||
|
|
||||||
|
@ -328,7 +328,8 @@ uint8_t index=0;
|
|||||||
#define ESCAPE_CHAR '~'
|
#define ESCAPE_CHAR '~'
|
||||||
|
|
||||||
// decode text escapes, 1 hexbyte assumed
|
// decode text escapes, 1 hexbyte assumed
|
||||||
void decode_te(char *line) {
|
uint32_t decode_te(char *line) {
|
||||||
|
uint32_t skip = 0;
|
||||||
char sbuf[3],*cp;
|
char sbuf[3],*cp;
|
||||||
while (*line) {
|
while (*line) {
|
||||||
if (*line==ESCAPE_CHAR) {
|
if (*line==ESCAPE_CHAR) {
|
||||||
@ -336,11 +337,12 @@ void decode_te(char *line) {
|
|||||||
if (*cp!=0 && *cp==ESCAPE_CHAR) {
|
if (*cp!=0 && *cp==ESCAPE_CHAR) {
|
||||||
// escape escape, discard one
|
// escape escape, discard one
|
||||||
memmove(cp,cp+1,strlen(cp));
|
memmove(cp,cp+1,strlen(cp));
|
||||||
|
skip++;
|
||||||
} else {
|
} else {
|
||||||
// escape HH
|
// escape HH
|
||||||
if (strlen(cp)<2) {
|
if (strlen(cp)<2) {
|
||||||
// illegal lenght, ignore
|
// illegal lenght, ignore
|
||||||
return;
|
return skip;
|
||||||
}
|
}
|
||||||
// take 2 hex chars
|
// take 2 hex chars
|
||||||
sbuf[0]=*(cp);
|
sbuf[0]=*(cp);
|
||||||
@ -349,10 +351,12 @@ void decode_te(char *line) {
|
|||||||
*line=strtol(sbuf,0,16);
|
*line=strtol(sbuf,0,16);
|
||||||
// must shift string 2 bytes shift zero also
|
// must shift string 2 bytes shift zero also
|
||||||
memmove(cp,cp+2,strlen(cp)-1);
|
memmove(cp,cp+2,strlen(cp)-1);
|
||||||
|
skip += 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
line++;
|
line++;
|
||||||
}
|
}
|
||||||
|
return skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------------------------*/
|
||||||
@ -829,10 +833,13 @@ void DisplayText(void)
|
|||||||
}
|
}
|
||||||
exit:
|
exit:
|
||||||
// now draw buffer
|
// now draw buffer
|
||||||
decode_te(linebuf);
|
dp -= decode_te(linebuf);
|
||||||
if ((uint32_t)dp - (uint32_t)linebuf) {
|
if ((uint32_t)dp - (uint32_t)linebuf) {
|
||||||
if (!fill) *dp = 0;
|
if (!fill) {
|
||||||
else linebuf[abs(fill)] = 0;
|
*dp = 0;
|
||||||
|
} else {
|
||||||
|
linebuf[abs(fill)] = 0;
|
||||||
|
}
|
||||||
if (fill<0) {
|
if (fill<0) {
|
||||||
// right align
|
// right align
|
||||||
alignright(linebuf);
|
alignright(linebuf);
|
||||||
@ -1276,7 +1283,7 @@ void DisplaySetPower(void)
|
|||||||
{
|
{
|
||||||
disp_power = bitRead(XdrvMailbox.index, disp_device -1);
|
disp_power = bitRead(XdrvMailbox.index, disp_device -1);
|
||||||
|
|
||||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("DSP: Power %d"), disp_power);
|
//AddLog_P2(LOG_LEVEL_DEBUG, PSTR("DSP: Power %d"), disp_power);
|
||||||
|
|
||||||
if (Settings.display_model) {
|
if (Settings.display_model) {
|
||||||
if (!renderer) {
|
if (!renderer) {
|
||||||
|
@ -85,6 +85,10 @@ void LcdInitDriver(void)
|
|||||||
|
|
||||||
void LcdDrawStringAt(void)
|
void LcdDrawStringAt(void)
|
||||||
{
|
{
|
||||||
|
if (dsp_flag) { // Supply Line and Column starting with Line 1 and Column 1
|
||||||
|
dsp_x--;
|
||||||
|
dsp_y--;
|
||||||
|
}
|
||||||
lcd->setCursor(dsp_x, dsp_y);
|
lcd->setCursor(dsp_x, dsp_y);
|
||||||
lcd->print(dsp_str);
|
lcd->print(dsp_str);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"""
|
"""
|
||||||
decode-status.py - decode status for Tasmota
|
decode-status.py - decode status for Tasmota
|
||||||
|
|
||||||
Copyright (C) 2019 Theo Arends
|
Copyright (C) 2020 Theo Arends
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
Loading…
x
Reference in New Issue
Block a user