forked from espressif/esp-idf
change(twai): don't panic if twai hal init fail
Related to https://github.com/espressif/esp-idf/pull/15068
This commit is contained in:
@@ -547,8 +547,10 @@ esp_err_t twai_driver_install_v2(const twai_general_config_t *g_config, const tw
|
|||||||
.clock_source_hz = clock_source_hz,
|
.clock_source_hz = clock_source_hz,
|
||||||
.controller_id = controller_id,
|
.controller_id = controller_id,
|
||||||
};
|
};
|
||||||
bool res = twai_hal_init(&p_twai_obj->hal, &hal_config);
|
if (twai_hal_init(&p_twai_obj->hal, &hal_config) == false) {
|
||||||
assert(res);
|
ret = ESP_ERR_INVALID_STATE;
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
twai_hal_configure(&p_twai_obj->hal, t_config, f_config, DRIVER_DEFAULT_INTERRUPTS, g_config->clkout_divider);
|
twai_hal_configure(&p_twai_obj->hal, t_config, f_config, DRIVER_DEFAULT_INTERRUPTS, g_config->clkout_divider);
|
||||||
|
|
||||||
//Assign GPIO and Interrupts
|
//Assign GPIO and Interrupts
|
||||||
|
Reference in New Issue
Block a user