mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
refactor(driver_twai): remove errata config selection 1
This commit is contained in:
@@ -28,7 +28,13 @@
|
||||
#include "soc/dport_reg.h"
|
||||
|
||||
#define TWAI_LL_GET_HW(controller_id) ((controller_id == 0) ? (&TWAI) : NULL)
|
||||
#define TWAI_LL_BRP_DIV_THRESH 128
|
||||
|
||||
// When the bus-off condition is reached, the REC should be reset to 0 and frozen (via LOM) by the
|
||||
// driver's ISR. However on the ESP32, there is an edge case where the REC will increase before the
|
||||
// driver's ISR can respond in time (e.g., due to the rapid occurrence of bus errors), thus causing the
|
||||
// REC to be non-zero after bus-off. A non-zero REC can prevent bus-off recovery as the bus-off recovery
|
||||
// condition is that both TEC and REC become 0.
|
||||
#define TWAI_LL_HAS_BUSOFF_REC_ISSUE 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -38,6 +44,7 @@ static uint32_t twai_ll_get_brp_max(void);
|
||||
/* ------------------------- Defines and Typedefs --------------------------- */
|
||||
#define TWAI_LL_BRP_MIN 2
|
||||
#define TWAI_LL_BRP_MAX twai_ll_get_brp_max() // max brp of esp32 is depends on chip version
|
||||
#define TWAI_LL_BRP_DIV_THRESH 128
|
||||
#define TWAI_LL_TSEG1_MIN 1
|
||||
#define TWAI_LL_TSEG2_MIN 1
|
||||
#define TWAI_LL_TSEG1_MAX 16 //the max register value
|
||||
|
||||
Reference in New Issue
Block a user