diff options
| author | Pablo MartÃnez <58857054+elpekenin@users.noreply.github.com> | 2025-05-22 15:31:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-22 23:31:15 +1000 |
| commit | 955809bd5aee8b1444595b450eeeef1f42799995 (patch) | |
| tree | 08da1f696605925286f681a2b738fa5f35cd0386 /platforms/chibios | |
| parent | fa24b0fcce2c5f3330f2d798c3caf91a130babdb (diff) | |
Add `compiler_support.h` (#25274)
Diffstat (limited to 'platforms/chibios')
| -rw-r--r-- | platforms/chibios/chibios_config.h | 4 | ||||
| -rw-r--r-- | platforms/chibios/drivers/wear_leveling/wear_leveling_rp2040_flash.c | 6 |
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 @@ | |||
| 15 | */ | 15 | */ |
| 16 | #pragma once | 16 | #pragma once |
| 17 | 17 | ||
| 18 | #include "compiler_support.h" | ||
| 19 | |||
| 18 | #ifndef USB_VBUS_PIN | 20 | #ifndef USB_VBUS_PIN |
| 19 | # define SPLIT_USB_DETECT // Force this on when dedicated pin is not used | 21 | # define SPLIT_USB_DETECT // Force this on when dedicated pin is not used |
| 20 | #endif | 22 | #endif |
| @@ -26,7 +28,7 @@ | |||
| 26 | # define REALTIME_COUNTER_CLOCK 1000000 | 28 | # define REALTIME_COUNTER_CLOCK 1000000 |
| 27 | 29 | ||
| 28 | # define USE_GPIOV1 | 30 | # define USE_GPIOV1 |
| 29 | # define PAL_OUTPUT_TYPE_OPENDRAIN _Static_assert(0, "RP2040 has no Open Drain GPIO configuration, setting this is not possible"); | 31 | # define PAL_OUTPUT_TYPE_OPENDRAIN STATIC_ASSERT(0, "RP2040 has no Open Drain GPIO configuration, setting this is not possible"); |
| 30 | 32 | ||
| 31 | /* Aliases for GPIO PWM channels - every pin has at least one PWM channel | 33 | /* Aliases for GPIO PWM channels - every pin has at least one PWM channel |
| 32 | * assigned */ | 34 | * 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 @@ | |||
| 6 | * SPDX-License-Identifier: BSD-3-Clause | 6 | * SPDX-License-Identifier: BSD-3-Clause |
| 7 | */ | 7 | */ |
| 8 | 8 | ||
| 9 | #include <stdbool.h> | ||
| 10 | |||
| 9 | #include "pico/bootrom.h" | 11 | #include "pico/bootrom.h" |
| 10 | #include "hardware/flash.h" | 12 | #include "hardware/flash.h" |
| 11 | #include "hardware/sync.h" | 13 | #include "hardware/sync.h" |
| 12 | #include "hardware/structs/ssi.h" | 14 | #include "hardware/structs/ssi.h" |
| 13 | #include "hardware/structs/ioqspi.h" | 15 | #include "hardware/structs/ioqspi.h" |
| 14 | 16 | ||
| 15 | #include <stdbool.h> | 17 | #include "compiler_support.h" |
| 16 | #include "timer.h" | 18 | #include "timer.h" |
| 17 | #include "wear_leveling.h" | 19 | #include "wear_leveling.h" |
| 18 | #include "wear_leveling_rp2040_flash_config.h" | 20 | #include "wear_leveling_rp2040_flash_config.h" |
| @@ -178,7 +180,7 @@ bool backing_store_erase(void) { | |||
| 178 | #endif | 180 | #endif |
| 179 | 181 | ||
| 180 | // Ensure the backing size can be cleanly subtracted from the flash size without alignment issues. | 182 | // Ensure the backing size can be cleanly subtracted from the flash size without alignment issues. |
| 181 | _Static_assert((WEAR_LEVELING_BACKING_SIZE) % (FLASH_SECTOR_SIZE) == 0, "Backing size must be a multiple of FLASH_SECTOR_SIZE"); | 183 | STATIC_ASSERT((WEAR_LEVELING_BACKING_SIZE) % (FLASH_SECTOR_SIZE) == 0, "Backing size must be a multiple of FLASH_SECTOR_SIZE"); |
| 182 | 184 | ||
| 183 | interrupts = save_and_disable_interrupts(); | 185 | interrupts = save_and_disable_interrupts(); |
| 184 | flash_range_erase((WEAR_LEVELING_RP2040_FLASH_BASE), (WEAR_LEVELING_BACKING_SIZE)); | 186 | flash_range_erase((WEAR_LEVELING_RP2040_FLASH_BASE), (WEAR_LEVELING_BACKING_SIZE)); |
