Skip to content

Commit

Permalink
updatte (#396)
Browse files Browse the repository at this point in the history
* Fix IR compilation for ESP32 with Arduino3 (arendst#19537)

* Update RELEASENOTES.md

* Preps for IDF5.1: microphone/input for i2s audio (arendst#19544)

* fix codec compilation on IDF5.1 (arendst#19546)

* I2S improvements to MP3 play (arendst#19547)

* Fix DS18B20 for ESP32 with over 33 gpios

* Update changelogs

---------

Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
Co-authored-by: Theo Arends <11044339+arendst@users.noreply.github.com>
Co-authored-by: Christian Baars <baars@klinikum-brandenburg.de>
  • Loading branch information
4 people authored Sep 19, 2023
1 parent f00d03c commit f71fb2d
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 106 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
- ESP32 Framework (Arduino Core) from v2.0.12 to v2.0.13

### Fixed
- ESP32 DS18x20 driver support extended over GPIO33

### Removed

Expand All @@ -37,7 +38,6 @@ All notable changes to this project will be documented in this file.
- Support for IPv6 link-local zones for esp-idf 5.1 (necessary for Matter)
- ESP32C3 relay click on restart


## [13.1.0.1] 20230831
### Added
- Commands to allow setting of timeprop parameters (#19310)
Expand Down
3 changes: 2 additions & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
### Breaking Changed

### Changed
- ESP32 Framework (Arduino Core) from v2.0.12 to v2.0.13
- ESP32 Framework (Arduino Core) from v2.0.11 to v2.0.13
- ESP32 LVGL library from v8.3.8 to v8.3.9 (no functional change)
- Display invert setting after tasmota start in uDisplay driver [#19337](https://github.com/arendst/Tasmota/issues/19337)

Expand All @@ -131,6 +131,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Teleinfo power [#19381](https://github.com/arendst/Tasmota/issues/19381)
- Exception 3 in IRHVAC [#19389](https://github.com/arendst/Tasmota/issues/19389)
- PCF8574 mode 1 with base relays exception 3/28 regression from v12.4.0.4 [#19408](https://github.com/arendst/Tasmota/issues/19408)
- ESP32 DS18x20 driver support extended over GPIO33
- ESP32 Support for IPv6 link-local zones for esp-idf 5.1 (necessary for Matter)
- ESP32 Shutter migration [#19454](https://github.com/arendst/Tasmota/issues/19454)
- ESP32 Shutter multi press button events [#19465](https://github.com/arendst/Tasmota/issues/19465)
Expand Down
82 changes: 43 additions & 39 deletions lib/lib_basic/OneWire-Stickbreaker/OneWire.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,102 +159,106 @@
static inline __attribute__((always_inline))
IO_REG_TYPE directRead(IO_REG_TYPE pin)
{
#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C6 // max. usable Pins are 23 for C6 (below flash pins)
// return digitalRead(pin); // Works most of the time
// return gpio_ll_get_level(&GPIO, pin); // The hal is not public api, don't use in application code

//#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
#if SOC_GPIO_PIN_COUNT <= 32
return (GPIO.in.val >> pin) & 0x1;
#else // plain ESP32
#else // ESP32 with over 32 gpios
if ( pin < 32 )
return (GPIO.in >> pin) & 0x1;
else if ( pin < 46 )
else
return (GPIO.in1.val >> (pin - 32)) & 0x1;
#endif

return 0;

}

static inline __attribute__((always_inline))
void directWriteLow(IO_REG_TYPE pin)
{
#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C6
// digitalWrite(pin, 0); // Works most of the time
// gpio_ll_set_level(&GPIO, pin, 0); // The hal is not public api, don't use in application code

//#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
#if SOC_GPIO_PIN_COUNT <= 32
GPIO.out_w1tc.val = ((uint32_t)1 << pin);
#else // plain ESP32
#else // ESP32 with over 32 gpios
if ( pin < 32 )
GPIO.out_w1tc = ((uint32_t)1 << pin);
else if ( pin < 46 )
else
GPIO.out1_w1tc.val = ((uint32_t)1 << (pin - 32));
#endif
}

static inline __attribute__((always_inline))
void directWriteHigh(IO_REG_TYPE pin)
{
#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C6
// digitalWrite(pin, 1); // Works most of the time
// gpio_ll_set_level(&GPIO, pin, 1); // The hal is not public api, don't use in application code

//#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
#if SOC_GPIO_PIN_COUNT <= 32
GPIO.out_w1ts.val = ((uint32_t)1 << pin);
#else // plain ESP32
#else // ESP32 with over 32 gpios
if ( pin < 32 )
GPIO.out_w1ts = ((uint32_t)1 << pin);
else if ( pin < 46 )
else
GPIO.out1_w1ts.val = ((uint32_t)1 << (pin - 32));
#endif

}

static inline __attribute__((always_inline))
void directModeInput(IO_REG_TYPE pin)
{
#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C6
GPIO.enable_w1tc.val = ((uint32_t)1 << (pin));
#else
// pinMode(pin, INPUT); // Too slow - doesn't work
// gpio_ll_output_disable(&GPIO, pin); // The hal is not public api, don't use in application code

if ( digitalPinIsValid(pin) )
{
#if ESP_IDF_VERSION_MAJOR < 4 // IDF 3.x ESP32/PICO-D4
uint32_t rtc_reg(rtc_gpio_desc[pin].reg);

if ( rtc_reg ) // RTC pins PULL settings
{
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].mux);
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].pullup | rtc_gpio_desc[pin].pulldown);
}
#endif
// Input
//#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
#if SOC_GPIO_PIN_COUNT <= 32
GPIO.enable_w1tc.val = ((uint32_t)1 << (pin));
#else // ESP32 with over 32 gpios
if ( pin < 32 )
GPIO.enable_w1tc = ((uint32_t)1 << pin);
else
GPIO.enable1_w1tc.val = ((uint32_t)1 << (pin - 32));
}
#endif
}

}

static inline __attribute__((always_inline))
void directModeOutput(IO_REG_TYPE pin)
{
#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C6
GPIO.enable_w1ts.val = ((uint32_t)1 << (pin));
#else
if ( digitalPinIsValid(pin) && pin <= 33 ) // pins above 33 can be only inputs
// pinMode(pin, OUTPUT); // Too slow - doesn't work
// gpio_ll_output_enable(&GPIO, pin); // The hal is not public api, don't use in application code

if ( digitalPinCanOutput(pin) )
{
#if ESP_IDF_VERSION_MAJOR < 4 // IDF 3.x ESP32/PICO-D4
uint32_t rtc_reg(rtc_gpio_desc[pin].reg);

if ( rtc_reg ) // RTC pins PULL settings
{
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].mux);
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].pullup | rtc_gpio_desc[pin].pulldown);
}
#endif
// Output
//#if CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6
#if SOC_GPIO_PIN_COUNT <= 32
GPIO.enable_w1ts.val = ((uint32_t)1 << (pin));
#else // ESP32 with over 32 gpios
if ( pin < 32 )
GPIO.enable_w1ts = ((uint32_t)1 << pin);
else // already validated to pins <= 33
else
GPIO.enable1_w1ts.val = ((uint32_t)1 << (pin - 32));
}
#endif
}

}

#define DIRECT_READ(base, pin) directRead(pin)
#define DIRECT_WRITE_LOW(base, pin) directWriteLow(pin)
#define DIRECT_WRITE_HIGH(base, pin) directWriteHigh(pin)
#define DIRECT_MODE_INPUT(base, pin) directModeInput(pin)
#define DIRECT_MODE_OUTPUT(base, pin) directModeOutput(pin)
//#warning "ESP32 OneWire testing"

#elif defined(__SAMD21G18A__)
#define PIN_TO_BASEREG(pin) portModeRegister(digitalPinToPort(pin))
Expand Down
3 changes: 2 additions & 1 deletion lib/libesp32_audio/es7243e/src/es7243e.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
#include "string.h"
#include "esp_log.h"
#include "rom/ets_sys.h"
#include "es7243e.h"
#include "es7243e.h"



static const char *TAG = "DRV7243E";
Expand Down
7 changes: 0 additions & 7 deletions tasmota/tasmota_support/support_esp.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1132,13 +1132,6 @@ bool CanUsePSRAM(void) {
if ((CHIP_ESP32 == chip_info.model) && (chip_revision < 300)) {
return false;
}
#if ESP_IDF_VERSION_MAJOR < 4
uint32_t pkg_version = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG) & 0x7;
if ((CHIP_ESP32 == chip_info.model) && (pkg_version >= 6)) {
return false; // support for embedded PSRAM of ESP32-PICO-V3-02 requires esp-idf 4.4
}
#endif // ESP_IDF_VERSION_MAJOR < 4

#endif // CONFIG_IDF_TARGET_ESP32
return true;
}
Expand Down
12 changes: 6 additions & 6 deletions tasmota/tasmota_xdrv_driver/xdrv_05_irremote_full.ino
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ namespace {
if (modelStr != kUnknownStr) {
json.add(key, modelStr);
} else { // Fallback to int value
json.add(key, model);
json.add(key, (int32_t)model);
}
}
} // namespace {
Expand All @@ -258,13 +258,13 @@ String sendACJsonState(const stdAc::state_t &state) {
case stdAc::ac_command_t::kConfigCommand:
// Note: for `kConfigCommand` the semantics of clock/sleep is abused IRremoteESP8266 lib-side for key/value pair
// Ref: lib/lib_basic/IRremoteESP8266/IRremoteESP8266/src/IRac.cpp[L3062-3066]
json.add(PSTR(D_JSON_IRHVAC_CONFIG_KEY), state.clock);
json.add(PSTR(D_JSON_IRHVAC_CONFIG_VALUE), state.sleep);
json.add(PSTR(D_JSON_IRHVAC_CONFIG_KEY), (int32_t)state.clock);
json.add(PSTR(D_JSON_IRHVAC_CONFIG_VALUE), (int32_t)state.sleep);
break;
case stdAc::ac_command_t::kTimerCommand:
json.add(PSTR(D_JSON_IRHVAC_POWER), IRac::boolToString(state.power));
if(state.clock != -1) { json.add(PSTR(D_JSON_IRHVAC_CLOCK), irutils::minsToString(state.clock)); }
json.add(PSTR(D_JSON_IRHVAC_SLEEP), state.sleep);
json.add(PSTR(D_JSON_IRHVAC_SLEEP), (int32_t)state.sleep);
break;
case stdAc::ac_command_t::kControlCommand:
default:
Expand All @@ -288,8 +288,8 @@ String sendACJsonState(const stdAc::state_t &state) {
json.add(PSTR(D_JSON_IRHVAC_FILTER), IRac::boolToString(state.filter));
json.add(PSTR(D_JSON_IRHVAC_CLEAN), IRac::boolToString(state.clean));
json.add(PSTR(D_JSON_IRHVAC_BEEP), IRac::boolToString(state.beep));
json.add(PSTR(D_JSON_IRHVAC_SLEEP), state.sleep);
if(state.clock != -1) { json.add(PSTR(D_JSON_IRHVAC_CLOCK), state.clock); }
json.add(PSTR(D_JSON_IRHVAC_SLEEP), (int32_t)state.sleep);
if(state.clock != -1) { json.add(PSTR(D_JSON_IRHVAC_CLOCK), (int32_t)state.clock); }
json.add(PSTR(D_JSON_IRHVAC_IFEEL), IRac::boolToString(state.iFeel));
addFloatToJson(json, PSTR(D_JSON_IRHVAC_SENSOR_TEMP), state.sensorTemperature, kNoTempValue);
break;
Expand Down
Loading

0 comments on commit f71fb2d

Please sign in to comment.