Skip to content

Commit

Permalink
mhz19b: Replace UART_SCLK_APB by UART_SCLK_DEFAULT for IDF5.0+ to fix…
Browse files Browse the repository at this point in the history
… build with esp32c6

UART_SCLK_APB does not exist in esp32c6.

Fixes: #577
Signed-off-by: Axel Lin <axel.lin@ingics.com>
  • Loading branch information
AxelLin committed Sep 27, 2023
1 parent 64d3cca commit ad65073
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/mhz19b/mhz19b.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down

0 comments on commit ad65073

Please sign in to comment.