TWAI: Simply caps and remove unused caps

This commit is contained in:
Darian Leung
2021-04-16 18:36:18 +08:00
parent b8e31efcac
commit 00801c8044
2 changed files with 7 additions and 19 deletions

View File

@@ -220,25 +220,14 @@
/*-------------------------- TWAI CAPS ---------------------------------------*/
#define SOC_TWAI_BRP_MIN 2
#define SOC_TWAI_SUPPORT_MULTI_ADDRESS_LAYOUT 1
#define SOC_TWAI_BRP_MAX_ECO0 128
//Any even number from 2 to 128
#define SOC_TWAI_BRP_IS_VALID_ECO0(brp) ((brp) >= 2 && (brp) <= 128 && ((brp) & 0x1) == 0)
#define SOC_TWAI_BRP_MAX_ECO 256
//Any even number from 2 to 128, or multiples of 4 from 132 to 256
#define SOC_TWAI_BRP_IS_VALID_ECO(brp) (((brp) >= 2 && (brp) <= 128 && ((brp) & 0x1) == 0) || ((brp) >= 132 && (brp) <= 256 && ((brp) & 0x3) == 0))
#if SOC_CAPS_ECO_VER >= 2
# define SOC_TWAI_BRP_MAX 256
# define SOC_TWAI_BRP_DIV_SUPPORTED 1
# define SOC_TWAI_BRP_DIV_THRESH 128
# define SOC_TWAI_BRP_IS_VALID SOC_TWAI_BRP_IS_VALID_ECO
# define SOC_TWAI_BRP_MAX SOC_TWAI_BRP_MAX_ECO
#else
# define SOC_TWAI_BRP_IS_VALID SOC_TWAI_BRP_IS_VALID_ECO0
# define SOC_TWAI_BRP_MAX SOC_TWAI_BRP_MAX_ECO0
# define SOC_TWAI_BRP_MAX 128
#endif
#define SOC_TWAI_SUPPORT_MULTI_ADDRESS_LAYOUT 1
/*-------------------------- UART CAPS ---------------------------------------*/
// ESP32 have 3 UART.
@@ -281,5 +270,8 @@
#define SOC_CAN_SUPPORTED SOC_TWAI_SUPPORTED
#define CAN_BRP_MIN SOC_TWAI_BRP_MIN
#define CAN_BRP_MAX SOC_TWAI_BRP_MAX
#define CAN_BRP_DIV_THRESH SOC_TWAI_BRP_DIV_THRESH
#define CAN_SUPPORT_MULTI_ADDRESS_LAYOUT SOC_TWAI_SUPPORT_MULTI_ADDRESS_LAYOUT
#if SOC_CAPS_ECO_VER >= 2
# define CAN_BRP_DIV_SUPPORTED SOC_TWAI_BRP_DIV_SUPPORTED
# define CAN_BRP_DIV_THRESH SOC_TWAI_BRP_DIV_THRESH
#endif