mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 21:26:33 +00:00
Merge branch 'development' into bmp
This commit is contained in:
commit
9249958d90
0
pio/espupload.py
Normal file → Executable file
0
pio/espupload.py
Normal file → Executable file
@ -1,4 +1,5 @@
|
|||||||
Import("env")
|
Import("env")
|
||||||
|
import os
|
||||||
|
|
||||||
# pio < 4.0.0
|
# pio < 4.0.0
|
||||||
# from base64 import b64decode
|
# from base64 import b64decode
|
||||||
@ -7,11 +8,6 @@ Import("env")
|
|||||||
# env.Replace(UPLOADCMD="$UPLOADER -u " + b64decode(ARGUMENTS.get("UPLOAD_PORT")) + " -f $SOURCES")
|
# env.Replace(UPLOADCMD="$UPLOADER -u " + b64decode(ARGUMENTS.get("UPLOAD_PORT")) + " -f $SOURCES")
|
||||||
|
|
||||||
# pio >= 4.0.0
|
# pio >= 4.0.0
|
||||||
env.Replace(UPLOADER="pio\espupload.py")
|
env.Replace(UPLOADER=os.path.join("pio", "espupload.py"))
|
||||||
env.Replace(UPLOADERFLAGS="")
|
env.Replace(UPLOADERFLAGS="")
|
||||||
env.Replace(UPLOADCMD="$UPLOADER -u $UPLOAD_PORT -f $SOURCES")
|
env.Replace(UPLOADCMD="$UPLOADER -u $UPLOAD_PORT -f $SOURCES")
|
||||||
|
|
||||||
'''
|
|
||||||
env.Replace(UPLOADCMD="pio\espupload.py -f $SOURCES") # Windows
|
|
||||||
env.Replace(UPLOADCMD="pio/espupload.py -f $SOURCES") # Linux
|
|
||||||
'''
|
|
@ -59,12 +59,14 @@ extra_scripts = ${scripts_defaults.extra_scripts}
|
|||||||
; *** Upload file to OTA server using SCP
|
; *** Upload file to OTA server using SCP
|
||||||
;upload_port = user@host:/path
|
;upload_port = user@host:/path
|
||||||
;extra_scripts = ${scripts_defaults.extra_scripts}
|
;extra_scripts = ${scripts_defaults.extra_scripts}
|
||||||
; pio/strip-floats.py, pio/sftp-uploader.py
|
; pio/strip-floats.py
|
||||||
|
; pio/sftp-uploader.py
|
||||||
|
|
||||||
; *** Upload file to OTA server in folder api/arduino using HTTP
|
; *** Upload file to OTA server in folder api/arduino using HTTP
|
||||||
;upload_port = domus1:80/api/upload-arduino.php
|
;upload_port = domus1:80/api/upload-arduino.php
|
||||||
;extra_scripts = ${scripts_defaults.extra_scripts}
|
;extra_scripts = ${scripts_defaults.extra_scripts}
|
||||||
; pio/strip-floats.py, pio/http-uploader.py
|
; pio/strip-floats.py
|
||||||
|
; pio/http-uploader.py
|
||||||
|
|
||||||
[core_active]
|
[core_active]
|
||||||
; Select one core set for platform and build_flags
|
; Select one core set for platform and build_flags
|
||||||
|
@ -6,10 +6,11 @@
|
|||||||
- Add optional support for Prometheus using file xsns_91_prometheus.ino (#7216)
|
- Add optional support for Prometheus using file xsns_91_prometheus.ino (#7216)
|
||||||
- Add command ``ShutterButton <parameters>`` to control shutter(s) by to-scho (#7403)
|
- Add command ``ShutterButton <parameters>`` to control shutter(s) by to-scho (#7403)
|
||||||
- Add experimental support for NRF24L01 as BLE-bridge for Mijia Bluetooth sensors by Christian Baars (#7394)
|
- Add experimental support for NRF24L01 as BLE-bridge for Mijia Bluetooth sensors by Christian Baars (#7394)
|
||||||
|
- Add support to BMP driver to enter reset state (sleep enable) when deep sleep is used in Tasmota
|
||||||
- Fix LCD line and column positioning (#7387)
|
- Fix LCD line and column positioning (#7387)
|
||||||
- Fix Display handling of hexadecimal escape characters (#7387)
|
- Fix Display handling of hexadecimal escape characters (#7387)
|
||||||
- Fix Improved fade linearity with gamma correction
|
- Fix Improved fade linearity with gamma correction
|
||||||
- Add support to BMP driver to enter reset state (sleep enable) when deep sleep is used in Tasmota
|
- Fix wrong gamma correction for Module 48 lights (PWM5 for CT)
|
||||||
|
|
||||||
### 8.1.0.1 20191225
|
### 8.1.0.1 20191225
|
||||||
|
|
||||||
|
@ -1709,9 +1709,6 @@ void LightAnimate(void)
|
|||||||
calcGammaMultiChannels(cur_col_10);
|
calcGammaMultiChannels(cur_col_10);
|
||||||
} else {
|
} else {
|
||||||
calcGammaBulbs(cur_col_10);
|
calcGammaBulbs(cur_col_10);
|
||||||
if (PHILIPS == my_module_type) {
|
|
||||||
calcGammaCTPwm(cur_col_10);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now see if we need to mix RGB and True White
|
// Now see if we need to mix RGB and True White
|
||||||
// Valid only for LST_RGBW, LST_RGBWC, rgbwwTable[4] is zero, and white is zero (see doc)
|
// Valid only for LST_RGBW, LST_RGBWC, rgbwwTable[4] is zero, and white is zero (see doc)
|
||||||
@ -1941,26 +1938,6 @@ void LightSetOutputs(const uint16_t *cur_col_10) {
|
|||||||
XdrvMailbox.topic = tmp_topic;
|
XdrvMailbox.topic = tmp_topic;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do specific computation is SetOption73 is on, Color Temp is a separate PWM channel
|
|
||||||
void calcGammaCTPwm(uint16_t cur_col_10[5]) {
|
|
||||||
// Xiaomi Philips bulbs follow a different scheme:
|
|
||||||
uint8_t cold, warm; // channel 1 is the color tone, mapped to cold channel (0..255)
|
|
||||||
light_state.getCW(&cold, &warm);
|
|
||||||
// channels for white are always the last two channels
|
|
||||||
uint32_t cw1 = Light.subtype - 1; // address for the ColorTone PWM
|
|
||||||
uint32_t cw0 = Light.subtype - 2; // address for the White Brightness PWM
|
|
||||||
// overall brightness
|
|
||||||
uint16_t pxBri10 = cur_col_10[cw0] + cur_col_10[cw1];
|
|
||||||
if (pxBri10 > 1023) { pxBri10 = 1023; }
|
|
||||||
cur_col_10[cw1] = changeUIntScale(cold, 0, cold + warm, 0, 1023); //
|
|
||||||
// channel 0=intensity, channel1=temperature
|
|
||||||
if (Settings.light_correction) { // gamma correction
|
|
||||||
cur_col_10[cw0] = ledGamma10_10(pxBri10); // 10 bits gamma correction
|
|
||||||
} else {
|
|
||||||
cur_col_10[cw0] = pxBri10; // no gamma, extend to 10 bits
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Just apply basic Gamma to each channel
|
// Just apply basic Gamma to each channel
|
||||||
void calcGammaMultiChannels(uint16_t cur_col_10[5]) {
|
void calcGammaMultiChannels(uint16_t cur_col_10[5]) {
|
||||||
// Apply gamma correction for 8 and 10 bits resolutions, if needed
|
// Apply gamma correction for 8 and 10 bits resolutions, if needed
|
||||||
@ -1976,22 +1953,35 @@ void calcGammaBulbs(uint16_t cur_col_10[5]) {
|
|||||||
if (Settings.light_correction) {
|
if (Settings.light_correction) {
|
||||||
// First apply combined correction to the overall white power
|
// First apply combined correction to the overall white power
|
||||||
if ((LST_COLDWARM == Light.subtype) || (LST_RGBWC == Light.subtype)) {
|
if ((LST_COLDWARM == Light.subtype) || (LST_RGBWC == Light.subtype)) {
|
||||||
uint8_t w_idx[2] = {0, 1}; // if LST_COLDWARM, channels 0 and 1
|
// channels for white are always the last two channels
|
||||||
if (LST_RGBWC == Light.subtype) { // if LST_RGBWC, channels 3 and 4
|
uint32_t cw1 = Light.subtype - 1; // address for the ColorTone PWM
|
||||||
w_idx[0] = 3;
|
uint32_t cw0 = Light.subtype - 2; // address for the White Brightness PWM
|
||||||
w_idx[1] = 4;
|
uint16_t white_bri10 = cur_col_10[cw0] + cur_col_10[cw1]; // cumulated brightness
|
||||||
}
|
uint16_t white_bri10_1023 = (white_bri10 > 1023) ? 1023 : white_bri10; // max 1023
|
||||||
uint16_t white_bri10 = cur_col_10[w_idx[0]] + cur_col_10[w_idx[1]];
|
|
||||||
// if sum of both channels is > 255, then channels are probablu uncorrelated
|
if (PHILIPS == my_module_type) { // channel 1 is the color tone, mapped to cold channel (0..255)
|
||||||
if (white_bri10 <= 1023) {
|
// Xiaomi Philips bulbs follow a different scheme:
|
||||||
// we calculate the gamma corrected sum of CW + WW
|
uint8_t cold, warm;
|
||||||
uint16_t white_bri_10bits = ledGamma10_10(white_bri10);
|
light_state.getCW(&cold, &warm);
|
||||||
// then we split the total energy among the cold and warm leds
|
cur_col_10[cw1] = changeUIntScale(cold, 0, cold + warm, 0, 1023); //
|
||||||
cur_col_10[w_idx[0]] = changeUIntScale(cur_col_10[w_idx[0]], 0, white_bri10, 0, white_bri_10bits);
|
// channel 0=intensity, channel1=temperature
|
||||||
cur_col_10[w_idx[1]] = changeUIntScale(cur_col_10[w_idx[1]], 0, white_bri10, 0, white_bri_10bits);
|
if (Settings.light_correction) { // gamma correction
|
||||||
|
cur_col_10[cw0] = ledGamma10_10(white_bri10_1023); // 10 bits gamma correction
|
||||||
|
} else {
|
||||||
|
cur_col_10[cw0] = white_bri10_1023; // no gamma, extend to 10 bits
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cur_col_10[w_idx[0]] = ledGamma10_10(cur_col_10[w_idx[0]]);
|
// if sum of both channels is > 255, then channels are probably uncorrelated
|
||||||
cur_col_10[w_idx[1]] = ledGamma10_10(cur_col_10[w_idx[1]]);
|
if (white_bri10 <= 1031) { // take a margin of 8 above 1023 to account for rounding errors
|
||||||
|
// we calculate the gamma corrected sum of CW + WW
|
||||||
|
uint16_t white_bri_gamma10 = ledGamma10_10(white_bri10_1023);
|
||||||
|
// then we split the total energy among the cold and warm leds
|
||||||
|
cur_col_10[cw0] = changeUIntScale(cur_col_10[cw0], 0, white_bri10_1023, 0, white_bri_gamma10);
|
||||||
|
cur_col_10[cw1] = changeUIntScale(cur_col_10[cw1], 0, white_bri10_1023, 0, white_bri_gamma10);
|
||||||
|
} else {
|
||||||
|
cur_col_10[cw0] = ledGamma10_10(cur_col_10[cw0]);
|
||||||
|
cur_col_10[cw1] = ledGamma10_10(cur_col_10[cw1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// then apply gamma correction to RGB channels
|
// then apply gamma correction to RGB channels
|
||||||
|
@ -83,7 +83,7 @@ void SSD1306InitDriver(void)
|
|||||||
// init renderer
|
// init renderer
|
||||||
// oled1306 = new Adafruit_SSD1306(SSD1306_LCDWIDTH,SSD1306_LCDHEIGHT);
|
// oled1306 = new Adafruit_SSD1306(SSD1306_LCDWIDTH,SSD1306_LCDHEIGHT);
|
||||||
oled1306 = new Adafruit_SSD1306(Settings.display_width, Settings.display_height, &Wire, reset_pin);
|
oled1306 = new Adafruit_SSD1306(Settings.display_width, Settings.display_height, &Wire, reset_pin);
|
||||||
oled1306->begin(SSD1306_SWITCHCAPVCC, Settings.display_address[0], 0);
|
oled1306->begin(SSD1306_SWITCHCAPVCC, Settings.display_address[0], reset_pin >= 0);
|
||||||
renderer = oled1306;
|
renderer = oled1306;
|
||||||
renderer->DisplayInit(DISPLAY_INIT_MODE, Settings.display_size, Settings.display_rotate, Settings.display_font);
|
renderer->DisplayInit(DISPLAY_INIT_MODE, Settings.display_size, Settings.display_rotate, Settings.display_font);
|
||||||
renderer->setTextColor(1,0);
|
renderer->setTextColor(1,0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user