From 153834465bee9f1e26008c728a656180b6343f5f Mon Sep 17 00:00:00 2001 From: Siddharth Purohit Date: Mon, 3 May 2021 18:23:04 +0530 Subject: [PATCH] AP_HAL: add HAL_CANFD_SUPPORTED define --- libraries/AP_HAL/AP_HAL_Boards.h | 4 ++++ libraries/AP_HAL/board/chibios.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/libraries/AP_HAL/AP_HAL_Boards.h b/libraries/AP_HAL/AP_HAL_Boards.h index a9560e014f..d98c36f27d 100644 --- a/libraries/AP_HAL/AP_HAL_Boards.h +++ b/libraries/AP_HAL/AP_HAL_Boards.h @@ -282,6 +282,10 @@ // plus one static notch with one harmonic #define HAL_HNF_MAX_FILTERS 18 #endif +#endif // HAL_HNF_MAX_FILTERS + +#ifndef HAL_CANFD_SUPPORTED +#define HAL_CANFD_SUPPORTED 0 #endif #ifndef __RAMFUNC__ diff --git a/libraries/AP_HAL/board/chibios.h b/libraries/AP_HAL/board/chibios.h index fa3e48511e..34b5726af2 100644 --- a/libraries/AP_HAL/board/chibios.h +++ b/libraries/AP_HAL/board/chibios.h @@ -128,3 +128,9 @@ #ifndef HAL_BOARD_STORAGE_DIRECTORY #define HAL_BOARD_STORAGE_DIRECTORY "/APM" #endif + +#if defined(STM32H7XX) || defined(STM32G4) +#define HAL_CANFD_SUPPORTED 1 +# else +#define HAL_CANFD_SUPPORTED 0 +#endif