mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
refactor(driver_twai): remove errata config selection 2
This commit is contained in:
@@ -7,12 +7,6 @@ menu "Legacy TWAI Driver Configurations"
|
||||
help
|
||||
Place the TWAI ISR in to IRAM to reduce latency and increase performance
|
||||
|
||||
config TWAI_SKIP_LEGACY_CONFLICT_CHECK
|
||||
bool "Skip legacy driver conflict check"
|
||||
default n
|
||||
help
|
||||
This configuration option used to bypass the conflict check mechanism with legacy code.
|
||||
|
||||
config TWAI_SUPPRESS_DEPRECATE_WARN
|
||||
bool "Suppress legacy driver deprecated warning"
|
||||
default n
|
||||
@@ -21,14 +15,11 @@ menu "Legacy TWAI Driver Configurations"
|
||||
(driver/twai.h). If you want to continue using the legacy driver,
|
||||
and don't want to see related deprecation warnings, you can enable this option.
|
||||
|
||||
config TWAI_ERRATA_FIX_TX_INTR_LOST
|
||||
bool "Add SW workaround for TX interrupt lost errata"
|
||||
depends on IDF_TARGET_ESP32
|
||||
default y
|
||||
config TWAI_SKIP_LEGACY_CONFLICT_CHECK
|
||||
bool "Skip legacy driver conflict check"
|
||||
default n
|
||||
help
|
||||
On the ESP32, when a transmit interrupt occurs, and interrupt register is read on the same APB clock
|
||||
cycle, the transmit interrupt could be lost. Enabling this option will add a workaround that checks the
|
||||
transmit buffer status bit to recover any lost transmit interrupt.
|
||||
This configuration option used to bypass the conflict check mechanism with legacy code.
|
||||
|
||||
config TWAI_ERRATA_FIX_RX_FRAME_INVALID
|
||||
bool "Add SW workaround for invalid RX frame errata"
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
// condition is that both TEC and REC become 0.
|
||||
#define TWAI_LL_HAS_BUSOFF_REC_ISSUE 1
|
||||
|
||||
// On the ESP32, when a transmit interrupt occurs, and interrupt register is read on the same APB clock
|
||||
// cycle, the transmit interrupt could be lost.
|
||||
#define TWAI_LL_HAS_INTR_LOST_ISSUE 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -231,7 +231,8 @@ static inline uint32_t twai_hal_decode_interrupt(twai_hal_context_t *hal_ctx)
|
||||
TWAI_HAL_SET_BITS(events, TWAI_HAL_EVENT_RX_BUFF_FRAME);
|
||||
}
|
||||
//Transmit interrupt set whenever TX buffer becomes free
|
||||
#ifdef CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST
|
||||
#if TWAI_LL_HAS_INTR_LOST_ISSUE
|
||||
// Errata workaround: Check the transmit buffer status bit to recover any lost transmit interrupt.
|
||||
if ((interrupts & TWAI_LL_INTR_TI || hal_ctx->state_flags & TWAI_HAL_STATE_FLAG_TX_BUFF_OCCUPIED) && status & TWAI_LL_STATUS_TBS) {
|
||||
#else
|
||||
if (interrupts & TWAI_LL_INTR_TI) {
|
||||
|
||||
Reference in New Issue
Block a user