summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-08-11 00:51:51 +0700
committerhathach <[email protected]>2024-08-11 00:51:51 +0700
commit2871bb0da6c928f6593f7eaa7cd4e1c4c287db43 (patch)
tree782f8adb3821f7be9b785e589df89c30fe26650f /hw
parentc07928e1b3bb680cb55de3a55eae9ba3cb459694 (diff)
fix spi_set_format() -Wnull-dereference when compiling with -Os
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/rp2040/family.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/bsp/rp2040/family.c b/hw/bsp/rp2040/family.c
index 9360f7f57..250989ce9 100644
--- a/hw/bsp/rp2040/family.c
+++ b/hw/bsp/rp2040/family.c
@@ -275,7 +275,15 @@ static void max3421_init(void) {
gpio_set_function(MAX3421_SCK_PIN, GPIO_FUNC_SPI);
gpio_set_function(MAX3421_MOSI_PIN, GPIO_FUNC_SPI);
gpio_set_function(MAX3421_MISO_PIN, GPIO_FUNC_SPI);
+
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wnull-dereference"
+#endif
spi_set_format(MAX3421_SPI, 8, SPI_CPOL_0, SPI_CPHA_0, SPI_MSB_FIRST);
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
}
//// API to enable/disable MAX3421 INTR pin interrupt