Commit Graph

67 Commits

Author SHA1 Message Date
Kuba Szczodrzyński a9630ac847
Support for LibreTiny platform (RTL8710, BK7231 & other modules) (#3509)
Co-authored-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
Co-authored-by: Sam Neirinck <git@samneirinck.com>
Co-authored-by: David Buezas <dbuezas@users.noreply.github.com>
Co-authored-by: Stroe Andrei Catalin <catalin2402@gmail.com>
Co-authored-by: Sam Neirinck <github@samneirinck.be>
Co-authored-by: Péter Sárközi <xmisterhu@gmail.com>
Co-authored-by: Hajo Noerenberg <hn@users.noreply.github.com>
2023-09-05 10:16:08 +12:00
Stijn Tintel f4ac176d77
core: read ESP32 MAC address from eFuse if IEEE802.15.4 is supported (#5176) 2023-08-07 22:45:50 +00:00
Mat931 98bf427600
Add standardized CRC helper functions (#4798)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-07-30 21:45:56 +00:00
Jesse Hills c835b67bac
Add host target platform (#4783)
Co-authored-by: Otto winter <otto@otto-winter.com>
2023-05-10 11:38:18 +12:00
Keith Burzinski c0ad5d1d16
Initial attempt at supporting ESP-IDF 5.0.0 (#4364)
* requirements: add pyparsing >= 3.0

ESP-IDF >= 5.0 requires pyparsing's rest_of_file, which was introduced
in version 3.0.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>

* esp32: fix build with ESP-IDF >= 5

We need to include esp_timer.h to be able to use esp_timer_get_time().
This header existed in ESP-IDF < 5 so we don't need if guards.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>

* ota: fix build with ESP-IDF >= 5

As of version 5, esp_task_wdt_init() takes a struct as argument. We also
need to include spi_flash_mmap.h.

[split unrelated change into separate commits, maintain ESP-IDF < 5
compat, use esp_task_wdt_reconfigure, add commit message]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>

* core: fix build with ESP-IDF >= 5

These header files already existed in ESP-IDF < 5 so skip if guards.

[add commit message]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>

* wifi: fix build with ESP-IDF >= 5

ESP-IDF 4.1 introduced the esp-netif API as successor to the tcp_adapter
API. The tcp_adapter API was removed in ESP-IDF 5.0.0. Part of the wifi
component was already migrated to the new API. Migrate the leftover uses
of the old API to the new API to fix build on ESP-IDF >= 5.

The version of ESP-IDF currently in use (4.4.4) supports the new API, so
we don't need any if guards to maintain backwards compatibility.

Also replace xQueueHandle, which is a pre FreeRTOS v8.0.0 data type,
with QueueHandle_t, so we don't need to enable backward compatibility
(CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY).

This reverts part of commit d42f35de5d to wifi_component_esp_idf.cpp,
as the esp-netif API handles that internally.

[replace pre FreeRTOS v8.0.0 data type, add commit message]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>

* mdns: fix build with ESP-IDF >= 5

In ESP-IDF 5.0.0, the mdns component was removed and moved to another
repository. Since the mdns component in esphome is always built, we
need to add the mdns component from the esp-protocols repository. This
component depends on ESP-IDF >= 5.0, so we need to add a version guard.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>

* docker: install python3-venv

As of version 6.0.1, platform-espressif32 requires python3-venv.
Switching between esp-idf 4.4.4 and 5.0 causes problems with esp-idf
python dependencies installed by PlatformIO. They've solved this by
using venv. Install python3-venv so that platform-espressif32 6.0.1 and
later can be used, and we don't need to wipe the dependencies manually
when switching esp-idf versions.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>

---------

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Co-authored-by: Stijn Tintel <stijn@linux-ipv6.be>
2023-04-20 03:54:06 +00:00
Jesse Hills d70e7da0ef
rp2040: Use fake Mutex lock (#4602) 2023-03-21 20:25:19 +00:00
Oxan van Leeuwen 86c0e6114f
Lock scheduler items while modifying them (#4410)
* Cosmetic fixes to scheduler code

* Add generic Mutex API

* Lock scheduler items while modifying them

* Always defer MQTT callbacks on Arduino
2023-02-26 18:43:08 +00:00
Jesse Hills 91925b1826
Update ESP-IDF and platform version (#3565)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-11-23 09:54:55 +13:00
Jesse Hills e61a01f7bb
Fix imports for rp2040 with no wifi (#3956) 2022-10-28 08:12:12 +13:00
Jesse Hills f97252b93a
Implement InterruptLock for RP2040 (#3945) 2022-10-26 16:41:51 +13:00
Jesse Hills 60717b074e
Implement different random for rp2040 (#3939) 2022-10-25 17:59:10 +13:00
Jesse Hills 6153bcc6ad
Initial Support for RP2040 platform (#3284)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-10-20 16:50:39 +13:00
Jesse Hills c317422ed7
Move crc16 to helpers (#3780) 2022-09-06 12:57:21 +12:00
anatoly-savchenkov 01a4443b6c
Webui small fixes (#3713) 2022-08-15 10:28:29 +12:00
Jesse Hills 4525588116
Add helper overloads for hex print 16-bit (#3297) 2022-03-16 13:35:37 +13:00
Otto Winter 3a67884451
Improve dallas timing (#3181)
* Improve dallas timing

* Format
2022-02-11 09:06:06 +01:00
Otto Winter 62b366a5ec
Fix ESP32C3 toolchain requires stdarg import in helpers (#3151) 2022-02-01 13:05:59 +01:00
Jesse Hills 4a5970b4af
Fix backwards string case helpers (#3126) 2022-01-31 10:58:27 +13:00
Oxan van Leeuwen 976f5d91ed
Logically group and document helper functions (#3112) 2022-01-27 20:35:42 +13:00
Oxan van Leeuwen 80d03a631e
Force braces around multi-line statements (#3094)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-25 08:56:36 +13:00
Oxan van Leeuwen 737188ae50
Fail hard if no random bytes available for encryption (#3067) 2022-01-18 14:29:57 +13:00
Oxan van Leeuwen 6383eca54a
Clean-up random helper functions (#3022) 2022-01-10 13:50:26 +13:00
Sergey Dudanov 9a70bfa471
New Midea IR component, improvements and fixes (#2847)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-10 11:47:19 +13:00
Oxan van Leeuwen 07e790f900
Drop uint{32,64}_to_string() helper functions (#3009) 2022-01-06 16:36:11 +01:00
Oxan van Leeuwen 640142fc0c
Introduce str_lower_case() and str_upper_case() helpers (#3008) 2022-01-06 16:35:59 +01:00
Oxan van Leeuwen 5c339d4597
Convert clamp() helper to backport of std::clamp() (#3010) 2022-01-07 00:56:10 +13:00
Oxan van Leeuwen a4931f5d78
Clean-up reverse_bits helpers (#3011) 2022-01-07 00:54:58 +13:00
Oxan van Leeuwen 5143a5b5c5
Use to_string() from STL when available (#2992) 2022-01-03 23:30:03 +01:00
Oxan van Leeuwen beeb0c7c5a
Introduce hex parsing & formatting helper functions (#2882) 2021-12-13 09:15:23 +13:00
anatoly-savchenkov cae283dc86
Fixed data type inside fast_random_8() routine (#2818) 2021-11-29 08:31:15 +13:00
Oxan van Leeuwen 10a2a7e0fc
Fix parsing numbers in Anova (#2816) 2021-11-29 08:00:29 +13:00
Oxan van Leeuwen 897277992b
Introduce str_snprintf helper function (#2780) 2021-11-23 20:30:49 +13:00
Oxan van Leeuwen 5404163be0
Clean-up MAC address helpers (#2713) 2021-11-15 15:48:16 +01:00
Oxan van Leeuwen 66cebfc992
Restore InterruptLock on wifi-less ESP8266 (#2712) 2021-11-15 08:05:11 +13:00
Oxan van Leeuwen 99c775d8cb
Introduce encode_value/decode_value() template functions (#2662) 2021-11-10 19:44:01 +01:00
Oxan van Leeuwen 4d43396835
Clean-up string sanitation helpers (#2660) 2021-11-10 19:42:41 +01:00
Oxan van Leeuwen 15f9677d33
Introduce parse_number() helper function (#2659) 2021-11-11 07:15:06 +13:00
Carlos Garcia Saura 875b803483
Remove "delay_microseconds_accurate()" and improve systemwide delayMicroseconds() (#2497) 2021-11-10 16:22:00 +13:00
Guillermo Ruffino d536509a63
Allow esp8266 to compile with no wifi (#2664) 2021-11-05 10:52:38 +13:00
Oxan van Leeuwen c0fc5b48ae
Fix pin/component switchup in SX1509 pin configuration (#2593) 2021-10-21 19:55:19 +02:00
Maurice Makaay c89018a431
Option to ignore CRC for EFuse MAC address (#2399)
* Accept changes as proposed by black.

* Added test and implemented optional correctly.

* Disable PHY RF full calibration (because it calls the breaking MAC retrieval function).

* Disable CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE instead of enable, dummy!

* Rename CONF_IGNORE_EFUSE_MAC_CRC to CONF_ESP32_IGNORE_EFUSE_MAC_CRC.

* Removed unused import.

* Fix ordering of constants.

* Moved all MAC address logic to core helpers.

* Use pretty MAC address for the log.

* Use standard MAC formatter function for debug component.

* Fix clang-formatting.

* Fix clang-formatting.

* Brought wording of comments in line with other function-describing comments.

* Processed code review by @OttoWinter

* Add USE_ESP32_IGNORE_EFUSE_MAC_CRC to defines.h

Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-09-30 18:08:15 +02:00
irtimaled c39ac9edfe
Support HSV-based color support on tuya light (#2400)
* fix: stop tuya light state getting reset

* fix typo

* Support for HSV color in Tuya

* Clamp formatting
2021-09-28 22:19:17 +02:00
Oxan van Leeuwen 5596751c2c
Add str_sprintf function that returns std::string (#2408) 2021-09-28 10:24:55 +13:00
irtimaled 7246f42a8e
Tuya rgb support (#2278)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-26 21:34:06 +13:00
Otto Winter 8503e08ee6
Fix InterruptLock on ESP-IDF (#2388) 2021-09-25 09:14:07 +02:00
Otto Winter ac0d921413
ESP-IDF support and generic target platforms (#2303)
* Socket refactor and SSL

* esp-idf temp

* Fixes

* Echo component and noise

* Add noise API transport support

* Updates

* ESP-IDF

* Complete

* Fixes

* Fixes

* Versions update

* New i2c APIs

* Complete i2c refactor

* SPI migration

* Revert ESP Preferences migration, too complex for now

* OTA support

* Remove echo again

* Remove ssl again

* GPIOFlags updates

* Rename esphal and ICACHE_RAM_ATTR

* Make ESP32 arduino compilable again

* Fix GPIO flags

* Complete pin registry refactor and fixes

* Fixes to make test1 compile

* Remove sdkconfig file

* Ignore sdkconfig file

* Fixes in reviewing

* Make test2 compile

* Make test4 compile

* Make test5 compile

* Run clang-format

* Fix lint errors

* Use esp-idf APIs instead of btStart

* Another round of fixes

* Start implementing ESP8266

* Make test3 compile

* Guard esp8266 code

* Lint

* Reformat

* Fixes

* Fixes v2

* more fixes

* ESP-IDF tidy target

* Convert ARDUINO_ARCH_ESPxx

* Update WiFiSignalSensor

* Update time ifdefs

* OTA needs millis from hal

* RestartSwitch needs delay from hal

* ESP-IDF Uart

* Fix OTA blank password

* Allow setting sdkconfig

* Fix idf partitions and allow setting sdkconfig from yaml

* Re-add read/write compat APIs and fix esp8266 uart

* Fix esp8266 store log strings in flash

* Fix ESP32 arduino preferences not initialized

* Update ifdefs

* Change how sdkconfig change is detected

* Add checks to ci-custom and fix them

* Run clang-format

* Add esp-idf clang-tidy target and fix errors

* Fixes from clang-tidy idf round 2

* Fixes from compiling tests with esp-idf

* Run clang-format

* Switch test5.yaml to esp-idf

* Implement ESP8266 Preferences

* Lint

* Re-do PIO package version selection a bit

* Fix arduinoespressif32 package version

* Fix unit tests

* Lint

* Lint fixes

* Fix readv/writev not defined

* Fix graphing component

* Re-add all old options from core/config.py

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-20 11:47:51 +02:00
Otto Winter a4867a00ea
Activate owning-memory clang-tidy check (#1891)
* Activate owning-memory clang-tidy check

* Lint

* Lint

* Fix issue with new NfcTag constructor

* Update pointers for number and select

* Add back the NOLINT to display buffer

* Fix merge

* DSMR fixes

* Nextion fixes

* Fix pipsolar

* Fix lwip socket

* Format

* Change socket fix

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-13 11:31:02 +02:00
Otto Winter e5051eefbc
API encryption (#2254) 2021-09-09 09:22:47 +12:00
Oxan van Leeuwen 5983ccc55c
Color mode implementation (#2012) 2021-07-29 19:11:56 +02:00
Stefan Agner 5cb0c11feb
Introduce clamp as a template function (#1953) 2021-07-14 17:08:18 +12:00