Bump version 7.0.0.2

Add command WebColor19 to control color of Module and Name (#6811)
This commit is contained in:
Theo Arends 2019-11-02 13:25:23 +01:00
parent b823a05e5d
commit 57e62b1e68
6 changed files with 37 additions and 10 deletions

View File

@ -1,4 +1,7 @@
/*********************************************************************************************\
* 7.0.0.2 20191102
* Add command WebColor19 to control color of Module and Name (#6811)
*
* 7.0.0.1 20191027
* Remove references to versions before 6.0
* Change default GUI to dark theme

View File

@ -432,10 +432,13 @@ struct SYSCFG {
uint16_t dimmer_hw_max; // E92
uint32_t deepsleep; // E94
uint16_t energy_power_delta; // E98
uint8_t shutter_motordelay[MAX_SHUTTERS]; // E9A
uint8_t free_e9e[342]; // E9E
uint8_t web_color2[1][3]; // FF4
uint8_t free_ff7 ; // FF7
uint8_t shutter_motordelay[MAX_SHUTTERS]; // E9A
uint8_t free_e9e[2]; // E9E
uint8_t web_color2[2][3]; // EA0 - Needs to be on integer distance / 3 from web_color
uint8_t free_ea4[338]; // EA6
uint32_t cfg_timestamp; // FF8
uint32_t cfg_crc32; // FFC

View File

@ -1115,6 +1115,10 @@ void SettingsDelta(void)
}
}
if (Settings.version < 0x07000002) {
char scolor[10];
WebHexCode(18, GetTextIndexed(scolor, sizeof(scolor), 18, kWebColors));
}
Settings.version = VERSION;
SettingsSave(1);
}

View File

@ -883,8 +883,9 @@ void WebHexCode(uint32_t i, const char* code)
color = w | (w << 4); // 00112233
}
*/
uint32_t j = sizeof(Settings.web_color)/3; // First area contains j=18 colors
if (i < j) {
uint32_t j = sizeof(Settings.web_color) / 3; // First area contains j = 18 colors
/*
if (i < j) {
Settings.web_color[i][0] = (color >> 16) & 0xFF; // Red
Settings.web_color[i][1] = (color >> 8) & 0xFF; // Green
Settings.web_color[i][2] = color & 0xFF; // Blue
@ -892,14 +893,30 @@ void WebHexCode(uint32_t i, const char* code)
Settings.web_color2[i-j][0] = (color >> 16) & 0xFF; // Red
Settings.web_color2[i-j][1] = (color >> 8) & 0xFF; // Green
Settings.web_color2[i-j][2] = color & 0xFF; // Blue
}
}
*/
if (i >= j) {
// Calculate i to index in Settings.web_color2 - Dirty(!) but saves 128 bytes code
i += ((((uint8_t*)&Settings.web_color2 - (uint8_t*)&Settings.web_color) / 3) - j);
}
Settings.web_color[i][0] = (color >> 16) & 0xFF; // Red
Settings.web_color[i][1] = (color >> 8) & 0xFF; // Green
Settings.web_color[i][2] = color & 0xFF; // Blue
}
uint32_t WebColor(uint32_t i)
{
uint32_t j = sizeof(Settings.web_color)/3; // First area contains j=18 colors
uint32_t j = sizeof(Settings.web_color) / 3; // First area contains j = 18 colors
/*
uint32_t tcolor = (i<j)? (Settings.web_color[i][0] << 16) | (Settings.web_color[i][1] << 8) | Settings.web_color[i][2] :
(Settings.web_color2[i-j][0] << 16) | (Settings.web_color2[i-j][1] << 8) | Settings.web_color2[i-j][2];
*/
if (i >= j) {
// Calculate i to index in Settings.web_color2 - Dirty(!) but saves 128 bytes code
i += ((((uint8_t*)&Settings.web_color2 - (uint8_t*)&Settings.web_color) / 3) - j);
}
uint32_t tcolor = (Settings.web_color[i][0] << 16) | (Settings.web_color[i][1] << 8) | Settings.web_color[i][2];
return tcolor;
}

View File

@ -20,6 +20,6 @@
#ifndef _TASMOTA_VERSION_H_
#define _TASMOTA_VERSION_H_
const uint32_t VERSION = 0x07000001;
const uint32_t VERSION = 0x07000002;
#endif // _TASMOTA_VERSION_H_

View File

@ -2579,7 +2579,7 @@ bool JsonWebColor(const char* dataBuf)
// Default (light)
// {"WebColor":["#000000","#ffffff","#f2f2f2","#000000","#ffffff","#000000","#ffffff","#ff0000","#008000","#ffffff","#1fa3ec","#0e70a4","#d43535","#931f1f","#47c266","#5aaf6f","#ffffff","#999999","#000000"]}
// Alternative (Dark)
// {"webcolor":["#eeeeee","#181818","#4f4f4f","#000000","#dddddd","#008000","#222222","#ff0000","#008000","#ffffff","#1fa3ec","#0e70a4","#d43535","#931f1f","#47c266","#5aaf6f","#ffffff","#999999","#000000"]}
// {"Webcolor":["#eeeeee","#181818","#4f4f4f","#000000","#dddddd","#6a9955","#1e1e1e","#ff0000","#008000","#ffffff","#1fa3ec","#0e70a4","#d43535","#931f1f","#47c266","#5aaf6f","#ffffff","#999999","#eeeeee"]}
char dataBufLc[strlen(dataBuf) +1];
LowerCase(dataBufLc, dataBuf);