mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-29 06:06:40 +00:00
Update to Arduino core ESP32 v2.0.2
This commit is contained in:
parent
b8ab3f54e3
commit
2e2a7423bf
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#define BACKLIGHT_CHANNEL 0
|
#define BACKLIGHT_CHANNEL 0
|
||||||
|
|
||||||
#ifndef ESP32S2
|
#if !defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||||
uint8_t temprature_sens_read();
|
uint8_t temprature_sens_read();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -185,11 +185,7 @@ void Esp32Device::set_backlight_pin(uint8_t pin)
|
|||||||
/* Setup Backlight Control Pin */
|
/* Setup Backlight Control Pin */
|
||||||
if(pin < GPIO_NUM_MAX) {
|
if(pin < GPIO_NUM_MAX) {
|
||||||
LOG_VERBOSE(TAG_GUI, F("Backlight : Pin %d"), pin);
|
LOG_VERBOSE(TAG_GUI, F("Backlight : Pin %d"), pin);
|
||||||
#ifndef ESP32S2
|
ledcSetup(BACKLIGHT_CHANNEL, 2000, 10);
|
||||||
ledcSetup(BACKLIGHT_CHANNEL, 20000, 12);
|
|
||||||
#else
|
|
||||||
ledcSetup(BACKLIGHT_CHANNEL, 20000, 10);
|
|
||||||
#endif
|
|
||||||
ledcAttachPin(pin, BACKLIGHT_CHANNEL);
|
ledcAttachPin(pin, BACKLIGHT_CHANNEL);
|
||||||
update_backlight();
|
update_backlight();
|
||||||
} else {
|
} else {
|
||||||
@ -222,15 +218,9 @@ bool Esp32Device::get_backlight_power()
|
|||||||
void Esp32Device::update_backlight()
|
void Esp32Device::update_backlight()
|
||||||
{
|
{
|
||||||
if(_backlight_pin < GPIO_NUM_MAX) {
|
if(_backlight_pin < GPIO_NUM_MAX) {
|
||||||
#ifndef ESP32S2
|
|
||||||
uint32_t duty = _backlight_power ? map(_backlight_level, 0, 255, 0, 4095) : 0;
|
|
||||||
if(_backlight_invert) duty = 4095 - duty;
|
|
||||||
ledcWrite(BACKLIGHT_CHANNEL, duty); // ledChannel and value
|
|
||||||
#else
|
|
||||||
uint32_t duty = _backlight_power ? map(_backlight_level, 0, 255, 0, 1023) : 0;
|
uint32_t duty = _backlight_power ? map(_backlight_level, 0, 255, 0, 1023) : 0;
|
||||||
if(_backlight_invert) duty = 1023 - duty;
|
if(_backlight_invert) duty = 1023 - duty;
|
||||||
ledcWrite(BACKLIGHT_CHANNEL, duty); // ledChannel and value
|
ledcWrite(BACKLIGHT_CHANNEL, duty); // ledChannel and value
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// haspTft.tft.writecommand(0x53); // Write CTRL Display
|
// haspTft.tft.writecommand(0x53); // Write CTRL Display
|
||||||
@ -322,7 +312,7 @@ void Esp32Device::get_info(JsonDocument& doc)
|
|||||||
|
|
||||||
void Esp32Device::get_sensors(JsonDocument& doc)
|
void Esp32Device::get_sensors(JsonDocument& doc)
|
||||||
{
|
{
|
||||||
#ifndef ESP32S2
|
#if !defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||||
JsonObject sensor = doc.createNestedObject(F("ESP32"));
|
JsonObject sensor = doc.createNestedObject(F("ESP32"));
|
||||||
uint32_t temp = (temprature_sens_read() - 32) * 100 / 1.8;
|
uint32_t temp = (temprature_sens_read() - 32) * 100 / 1.8;
|
||||||
sensor[F("Temperature")] = serialized(String(1.0f * temp / 100, 2));
|
sensor[F("Temperature")] = serialized(String(1.0f * temp / 100, 2));
|
||||||
|
@ -123,18 +123,11 @@ board_upload.maximum_size = 16777216
|
|||||||
board_build.partitions = user_setups/esp32/partitions_16MB.csv
|
board_build.partitions = user_setups/esp32/partitions_16MB.csv
|
||||||
|
|
||||||
|
|
||||||
; -- The Arduino ESP32 v2.0.1 with 3 available flash sizes:
|
; -- The Arduino ESP32 v2.0.2 with 3 available flash sizes:
|
||||||
[arduino_esp32_v2]
|
[arduino_esp32_v2]
|
||||||
framework = arduino
|
framework = arduino
|
||||||
;platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
|
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.2/platform-tasmota-espressif32-2.0.2.zip
|
||||||
;platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-idf-master
|
platform_packages =
|
||||||
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2idf/platform-espressif32-2.0.2.zip
|
|
||||||
platform_packages = framework-arduinoespressif32 @ https://github.com/tasmota/arduino-esp32/releases/download/2.0.1/framework-arduinoespressif32-release_IDF4.4.tar.gz
|
|
||||||
platformio/tool-esptoolpy @ https://github.com/tasmota/esptool/releases/download/v3.2/esptool-v3.2.zip
|
|
||||||
;;framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#mem-optimized
|
|
||||||
;framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#2.0.1
|
|
||||||
;;framework-arduinoespressif32 @ https://github.com/marcovannoord/arduino-esp32.git#idf-release/v4.0
|
|
||||||
;;toolchain-xtensa32 @ 3.80200.200512
|
|
||||||
board_build.embed_files =
|
board_build.embed_files =
|
||||||
data/edit.htm.gz
|
data/edit.htm.gz
|
||||||
data/style.css.gz
|
data/style.css.gz
|
||||||
|
Loading…
x
Reference in New Issue
Block a user