From d124a3e8d37924adebeba92d45a840ebac7f3fce Mon Sep 17 00:00:00 2001 From: descipher <120155735+GelidusResearch@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:05:21 -0500 Subject: [PATCH] Move tx cmd interval to component --- gdo.c | 4 ++-- include/gdo.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gdo.c b/gdo.c index d51f77f..5b3522a 100755 --- a/gdo.c +++ b/gdo.c @@ -101,7 +101,7 @@ static esp_timer_handle_t motion_detect_timer; static esp_timer_handle_t door_position_sync_timer; static esp_timer_handle_t obst_timer; static void *g_user_cb_arg; -static uint32_t g_tx_delay_ms = 250; // Less than 250 is too frequent and brownouts many wall controllers +static uint32_t g_tx_delay_ms = 50; static portMUX_TYPE gdo_spinlock = portMUX_INITIALIZER_UNLOCKED; @@ -753,7 +753,7 @@ esp_err_t gdo_set_close_duration(uint16_t ms) { * @return ESP_OK on success, ESP_ERR_INVALID_ARG if the time is invalid. */ esp_err_t gdo_set_min_command_interval(uint32_t ms) { - if (ms < 250) { + if (ms < 50) { ESP_LOGE(TAG, "Invalid minimum command interval: %" PRIu32, ms); return ESP_ERR_INVALID_ARG; } diff --git a/include/gdo.h b/include/gdo.h index b7ffed8..34339ee 100755 --- a/include/gdo.h +++ b/include/gdo.h @@ -157,6 +157,8 @@ typedef struct { gpio_num_t uart_tx_pin; // UART TX pin gpio_num_t uart_rx_pin; // UART RX pin gpio_num_t obst_in_pin; // Obstruction input pin + gpio_num_t rf_tx_pin; // UART TX pin + gpio_num_t rf_rx_pin; // UART RX pin } gdo_config_t; #define GDO_PAIRED_DEVICE_COUNT_UNKNOWN 0xff