Add compiler_support.h (#25274)

This commit is contained in:
Pablo Martínez 2025-05-22 15:31:15 +02:00 committed by GitHub
parent fa24b0fcce
commit 955809bd5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 142 additions and 81 deletions

View file

@ -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 */

View file

@ -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));