Skip to content

Commit

Permalink
Merge pull request #316 from nated0g/master
Browse files Browse the repository at this point in the history
moved ets_sys.h includes to seperate file
  • Loading branch information
UncleRus authored Apr 7, 2022
2 parents 66a6155 + 6d4616b commit a43fa64
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 156 deletions.
14 changes: 1 addition & 13 deletions components/bmp180/bmp180.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,7 @@

#include <esp_err.h>
#include <esp_log.h>
#if CONFIG_IDF_TARGET_ESP32
#include <esp32/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S3
#include <esp32s3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C3
#include <esp32c3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32H2
#include <esp32h2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C2
#include <esp32c2/rom/ets_sys.h>
#endif
#include <ets_sys.h>
#include <esp_idf_lib_helpers.h>

#define I2C_FREQ_HZ 1000000 // Max 1MHz for esp-idf
Expand Down
14 changes: 1 addition & 13 deletions components/dht/dht.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,7 @@
#include <freertos/FreeRTOS.h>
#include <string.h>
#include <esp_log.h>
#if CONFIG_IDF_TARGET_ESP32
#include <esp32/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S3
#include <esp32s3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C3
#include <esp32c3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32H2
#include <esp32h2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C2
#include <esp32c2/rom/ets_sys.h>
#endif
#include <ets_sys.h>
#include <esp_idf_lib_helpers.h>

// DHT timer precision in microseconds
Expand Down
14 changes: 1 addition & 13 deletions components/ds1302/ds1302.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,7 @@
*/
#include <freertos/FreeRTOS.h>
#include <string.h>
#if CONFIG_IDF_TARGET_ESP32
#include <esp32/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S3
#include <esp32s3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C3
#include <esp32c3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32H2
#include <esp32h2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C2
#include <esp32c2/rom/ets_sys.h>
#endif
#include <ets_sys.h>
#include <esp_idf_lib_helpers.h>
#include "ds1302.h"

Expand Down
13 changes: 13 additions & 0 deletions components/esp_idf_lib_helpers/ets_sys.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#if CONFIG_IDF_TARGET_ESP32
#include <esp32/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S3
#include <esp32s3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C3
#include <esp32c3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32H2
#include <esp32h2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C2
#include <esp32c2/rom/ets_sys.h>
#endif
14 changes: 1 addition & 13 deletions components/hd44780/hd44780.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,7 @@
#include <string.h>
#include <esp_system.h>
#include <esp_idf_lib_helpers.h>
#if CONFIG_IDF_TARGET_ESP32
#include <esp32/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S3
#include <esp32s3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C3
#include <esp32c3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32H2
#include <esp32h2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C2
#include <esp32c2/rom/ets_sys.h>
#endif
#include <ets_sys.h>
#include "hd44780.h"

#define MS 1000
Expand Down
14 changes: 1 addition & 13 deletions components/hx711/hx711.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,7 @@
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <esp_timer.h>
#if CONFIG_IDF_TARGET_ESP32
#include <esp32/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S3
#include <esp32s3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C3
#include <esp32c3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32H2
#include <esp32h2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C2
#include <esp32c2/rom/ets_sys.h>
#endif
#include <ets_sys.h>
#include <esp_idf_lib_helpers.h>
#include "hx711.h"

Expand Down
14 changes: 1 addition & 13 deletions components/led_strip/led_strip.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,7 @@
#include <esp_log.h>
#include <esp_attr.h>
#include <stdlib.h>
#if CONFIG_IDF_TARGET_ESP32
#include <esp32/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S3
#include <esp32s3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C3
#include <esp32c3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32H2
#include <esp32h2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C2
#include <esp32c2/rom/ets_sys.h>
#endif
#include <ets_sys.h>
#include <esp_idf_lib_helpers.h>

#if HELPER_TARGET_IS_ESP8266
Expand Down
14 changes: 1 addition & 13 deletions components/ms5611/ms5611.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,7 @@
#include <esp_log.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#if CONFIG_IDF_TARGET_ESP32
#include <esp32/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S3
#include <esp32s3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C3
#include <esp32c3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32H2
#include <esp32h2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C2
#include <esp32c2/rom/ets_sys.h>
#endif
#include <ets_sys.h>

#define I2C_FREQ_HZ 400000 // 400 kHz

Expand Down
14 changes: 1 addition & 13 deletions components/onewire/onewire.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,7 @@
#include <string.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#if CONFIG_IDF_TARGET_ESP32
#include <esp32/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S3
#include <esp32s3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C3
#include <esp32c3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32H2
#include <esp32h2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C2
#include <esp32c2/rom/ets_sys.h>
#endif
#include <ets_sys.h>
#include <esp_idf_lib_helpers.h>
#include "onewire.h"

Expand Down
14 changes: 1 addition & 13 deletions components/pca9685/pca9685.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,7 @@

#include <esp_system.h>
#include <esp_log.h>
#if CONFIG_IDF_TARGET_ESP32
#include <esp32/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S3
#include <esp32s3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C3
#include <esp32c3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32H2
#include <esp32h2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C2
#include <esp32c2/rom/ets_sys.h>
#endif
#include <ets_sys.h>

#define I2C_FREQ_HZ 1000000 // 1 Mhz

Expand Down
14 changes: 1 addition & 13 deletions components/scd4x/scd4x.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,7 @@
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <esp_log.h>
#if CONFIG_IDF_TARGET_ESP32
#include <esp32/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S3
#include <esp32s3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C3
#include <esp32c3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32H2
#include <esp32h2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C2
#include <esp32c2/rom/ets_sys.h>
#endif
#include <ets_sys.h>
#include <esp_idf_lib_helpers.h>
#include "scd4x.h"

Expand Down
14 changes: 1 addition & 13 deletions components/sgp40/sgp40.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,7 @@
#include <math.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#if CONFIG_IDF_TARGET_ESP32
#include <esp32/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S3
#include <esp32s3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C3
#include <esp32c3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32H2
#include <esp32h2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C2
#include <esp32c2/rom/ets_sys.h>
#endif
#include <ets_sys.h>

#define I2C_FREQ_HZ 400000

Expand Down
14 changes: 1 addition & 13 deletions components/ultrasonic/ultrasonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,7 @@
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <esp_timer.h>
#if CONFIG_IDF_TARGET_ESP32
#include <esp32/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S2
#include <esp32s2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32S3
#include <esp32s3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C3
#include <esp32c3/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32H2
#include <esp32h2/rom/ets_sys.h>
#elif CONFIG_IDF_TARGET_ESP32C2
#include <esp32c2/rom/ets_sys.h>
#endif
#include <ets_sys.h>

#define TRIGGER_LOW_DELAY 4
#define TRIGGER_HIGH_DELAY 10
Expand Down

0 comments on commit a43fa64

Please sign in to comment.