aboutsummaryrefslogtreecommitdiffstats
path: root/platforms/chibios
diff options
context:
space:
mode:
authorPablo Martínez2025-05-22 15:31:15 +0200
committerGitHub2025-05-22 15:31:15 +0200
commit955809bd5aee8b1444595b450eeeef1f42799995 (patch)
tree08da1f696605925286f681a2b738fa5f35cd0386 /platforms/chibios
parentfa24b0fcce2c5f3330f2d798c3caf91a130babdb (diff)
Add `compiler_support.h` (#25274)
Diffstat (limited to 'platforms/chibios')
-rw-r--r--platforms/chibios/chibios_config.h4
-rw-r--r--platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/platforms/chibios/chibios_config.h b/platforms/chibios/chibios_config.h
index 9ef8e9b4fe..41546e3e50 100644
--- a/platforms/chibios/chibios_config.h
+++ b/platforms/chibios/chibios_config.h
@@ -15,6 +15,8 @@
*/
#pragma once
+#include "compiler_support.h"
+
#ifndef USB_VBUS_PIN
# define SPLIT_USB_DETECT // Force this on when dedicated pin is not used
#endif
@@ -26,7 +28,7 @@
# define REALTIME_COUNTER_CLOCK 1000000
# define USE_GPIOV1
-# define PAL_OUTPUT_TYPE_OPENDRAIN _Static_assert(0, "RP2040 has no Open Drain GPIO configuration, setting this is not possible");
+# define PAL_OUTPUT_TYPE_OPENDRAIN STATIC_ASSERT(0, "RP2040 has no Open Drain GPIO configuration, setting this is not possible");
/* Aliases for GPIO PWM channels - every pin has at least one PWM channel
* assigned */
diff --git a/platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash.c b/platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash.c
index 9bfc68f9d2..2f3c7c58ca 100644
--- a/platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash.c
+++ b/platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash.c
@@ -6,13 +6,15 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <stdbool.h>
+
#include "pico/bootrom.h"
#include "hardware/flash.h"
#include "hardware/sync.h"
#include "hardware/structs/ssi.h"
#include "hardware/structs/ioqspi.h"
-#include <stdbool.h>
+#include "compiler_support.h"
#include "timer.h"
#include "wear_leveling.h"
#include "wear_leveling_rp2040_flash_config.h"
@@ -178,7 +180,7 @@ bool backing_store_erase(void) {
#endif
// Ensure the backing size can be cleanly subtracted from the flash size without alignment issues.
- _Static_assert((WEAR_LEVELING_BACKING_SIZE) % (FLASH_SECTOR_SIZE) == 0, "Backing size must be a multiple of FLASH_SECTOR_SIZE");
+ STATIC_ASSERT((WEAR_LEVELING_BACKING_SIZE) % (FLASH_SECTOR_SIZE) == 0, "Backing size must be a multiple of FLASH_SECTOR_SIZE");
interrupts = save_and_disable_interrupts();
flash_range_erase((WEAR_LEVELING_RP2040_FLASH_BASE), (WEAR_LEVELING_BACKING_SIZE));