diff --git a/components/mhz19b/mhz19b.c b/components/mhz19b/mhz19b.c index d12a7388..3aa5c8ce 100644 --- a/components/mhz19b/mhz19b.c +++ b/components/mhz19b/mhz19b.c @@ -60,7 +60,9 @@ esp_err_t mhz19b_init(mhz19b_dev_t *dev, uart_port_t uart_port, gpio_num_t tx_gp .parity = UART_PARITY_DISABLE, .stop_bits = UART_STOP_BITS_1, .flow_ctrl = UART_HW_FLOWCTRL_DISABLE, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0) +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) + .source_clk = UART_SCLK_DEFAULT, +#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0) .source_clk = UART_SCLK_APB, #endif };