I'm having issues with the CAN_GENERAL_CONFIG_DEFAULT() macro that don't make any sense to me. See the below function (which simply wraps up a default can_driver_install().
Code: Select all
esp_err_t InstallCAN(gpio_num_t canTxPin, gpio_num_t canRxPin, can_mode_t canMode)
{
// Initialise config structures using macro inits
can_general_config_t gConfig = CAN_GENERAL_CONFIG_DEFAULT(canTxPin, canRxPin, canMode);
can_timing_config_t tConfig = CAN_TIMING_CONFIG_25KBITS();
can_filter_config_t fConfig = CAN_FILTER_CONFIG_ACCEPT_ALL();
// Install CAN driver and return error code
return can_driver_install(&gConfig, &tConfig, &fConfig);
}