WIP
This commit is contained in:
parent
25b0b567fc
commit
0dd88f677a
@ -21,6 +21,7 @@ static QueueHandle_t _receive_queue = {0};
|
|||||||
static QueueHandle_t _gpio_interrupt_queue = {0};
|
static QueueHandle_t _gpio_interrupt_queue = {0};
|
||||||
static zh_onewire_slave_init_config_t _init_config = {0};
|
static zh_onewire_slave_init_config_t _init_config = {0};
|
||||||
static bool _is_initialized = false;
|
static bool _is_initialized = false;
|
||||||
|
static uint64_t last_low_level_time = 0xFFFFFFFF;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -160,10 +161,23 @@ static void _rx_processing(void *pvParameter)
|
|||||||
|
|
||||||
void _gpio_interrupt_callback(void *arg)
|
void _gpio_interrupt_callback(void *arg)
|
||||||
{
|
{
|
||||||
_gpio_interrupt_data_t data = {0};
|
// uint8_t level = gpio_get_level((_init_config.bus_pin + 1));
|
||||||
data.level = gpio_get_level((_init_config.bus_pin + 1));
|
// uint64_t time = esp_timer_get_time();
|
||||||
data.time = esp_timer_get_time();
|
if (gpio_get_level((_init_config.bus_pin + 1)) == 0)
|
||||||
xQueueSendFromISR(_gpio_interrupt_queue, &data, NULL);
|
{
|
||||||
|
last_low_level_time = esp_timer_get_time();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((esp_timer_get_time() - last_low_level_time) > (RESET_PULSE_DURATION * 0.9) && (esp_timer_get_time() - last_low_level_time) < (RESET_PULSE_DURATION * 2))
|
||||||
|
{
|
||||||
|
// Reset is detected.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// _gpio_interrupt_data_t data = {0};
|
||||||
|
// data.level = gpio_get_level((_init_config.bus_pin + 1));
|
||||||
|
// data.time = esp_timer_get_time();
|
||||||
|
// xQueueSendFromISR(_gpio_interrupt_queue, &data, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _gpio_interrupt_processing(void *pvParameter)
|
void _gpio_interrupt_processing(void *pvParameter)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user