From 44cb1afa4df57dcb7339f6691752b7d75ad52651 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Thu, 19 Jan 2017 13:50:36 -1000 Subject: [PATCH] Provide an overidable nop default for BOARD_EEPROM_WP_CTRL To simplify integration of an EEPROM device with a Write Protect control pin, we add an overidable BOARD_EEPROM_WP_CTRL macro the does nothing. A board that provids the GPIO for WP should define BOARD_EEPROM_WP_CTRL(_protected_true) that will set the WP GPIO to the Protected state when passed true. --- src/drivers/boards/common/board_common.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/drivers/boards/common/board_common.h b/src/drivers/boards/common/board_common.h index 61f1d4c832..ac29d2fbb1 100644 --- a/src/drivers/boards/common/board_common.h +++ b/src/drivers/boards/common/board_common.h @@ -92,6 +92,12 @@ #define PX4_SPI_BUS_ID(bd) (((bd) >> 4) & 0xf) #define PX4_SPI_DEV_ID(bd) ((bd) & 0xf) +/* Provide an overridable default nop + * for BOARD_EEPROM_WP_CTRL + */ +#if !defined(BOARD_EEPROM_WP_CTRL) +# define BOARD_EEPROM_WP_CTRL(on_true) +#endif /************************************************************************************ * Private Functions ************************************************************************************/