mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-10 06:31:24 +00:00
fix(twai): busoff and clkout may not available in SOC
return ESP_ERR_NOT_SUPPORTED if these signals are required from user but not available in SOC
This commit is contained in:
@@ -49,8 +49,12 @@ void app_main(void)
|
||||
{
|
||||
twai_node_handle_t node_hdl;
|
||||
twai_onchip_node_config_t node_config = {
|
||||
.io_cfg.tx = TX_GPIO_NUM,
|
||||
.io_cfg.rx = RX_GPIO_NUM,
|
||||
.io_cfg = {
|
||||
.tx = TX_GPIO_NUM,
|
||||
.rx = RX_GPIO_NUM,
|
||||
.quanta_clk_out = GPIO_NUM_NC,
|
||||
.bus_off_indicator = GPIO_NUM_NC,
|
||||
},
|
||||
.bit_timing.bitrate = TWAI_BITRATE,
|
||||
.tx_queue_depth = 1,
|
||||
.flags.enable_self_test = true,
|
||||
|
@@ -94,8 +94,8 @@ void app_main(void)
|
||||
.io_cfg = {
|
||||
.tx = TWAI_LISTENER_TX_GPIO,
|
||||
.rx = TWAI_LISTENER_RX_GPIO,
|
||||
.quanta_clk_out = -1,
|
||||
.bus_off_indicator = -1,
|
||||
.quanta_clk_out = GPIO_NUM_NC,
|
||||
.bus_off_indicator = GPIO_NUM_NC,
|
||||
},
|
||||
.bit_timing.bitrate = TWAI_BITRATE,
|
||||
.flags.enable_listen_only = true,
|
||||
|
@@ -57,8 +57,8 @@ void app_main(void)
|
||||
.io_cfg = {
|
||||
.tx = TWAI_SENDER_TX_GPIO,
|
||||
.rx = TWAI_SENDER_RX_GPIO,
|
||||
.quanta_clk_out = -1,
|
||||
.bus_off_indicator = -1,
|
||||
.quanta_clk_out = GPIO_NUM_NC,
|
||||
.bus_off_indicator = GPIO_NUM_NC,
|
||||
},
|
||||
.bit_timing = {
|
||||
.bitrate = TWAI_BITRATE,
|
||||
|
Reference in New Issue
Block a user