From a6e31ca42c8d32442835ce60e7d55dc3c4bb74fc Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Thu, 15 Jun 2023 15:53:10 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@16285 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/xhal/codegen/hal_spi.xml | 9 +++++++++ os/xhal/include/hal_spi.h | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/os/xhal/codegen/hal_spi.xml b/os/xhal/codegen/hal_spi.xml index d1062b10c..945cdb9be 100644 --- a/os/xhal/codegen/hal_spi.xml +++ b/os/xhal/codegen/hal_spi.xml @@ -36,6 +36,15 @@ + diff --git a/os/xhal/include/hal_spi.h b/os/xhal/include/hal_spi.h index 37e44f648..558bc6f0d 100644 --- a/os/xhal/include/hal_spi.h +++ b/os/xhal/include/hal_spi.h @@ -100,6 +100,15 @@ #error "invalid SPI_SELECT_MODE value" #endif +/* Some modes have a dependency on the PAL driver, making the required + checks here.*/ +#if ((SPI_SELECT_MODE != SPI_SELECT_MODE_PAD) || \ + (SPI_SELECT_MODE != SPI_SELECT_MODE_PORT) || \ + (SPI_SELECT_MODE != SPI_SELECT_MODE_LINE)) && \ + (HAL_USE_PAL != TRUE) +#error "current SPI_SELECT_MODE requires HAL_USE_PAL" +#endif + /*===========================================================================*/ /* Module macros. */ /*===========================================================================*/