Skip to content

Commit b33481f

Browse files
Fix RP2040 build
1 parent 3466a4c commit b33481f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cores/rp2040/flash_wrapper.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <hardware/structs/qmi.h>
2525
#endif
2626

27-
#if defined(RP2350_PSRAM_CS)
27+
#if defined(PICO_RP2350) && defined(RP2350_PSRAM_CS)
2828
static volatile uint32_t __wastedsum = 0;
2929
static void __no_inline_not_in_flash_func(flushcache)() {
3030
//for (volatile uint8_t* cache = (volatile uint8_t*)0x18000001; cache < (volatile uint8_t*)(0x18000001 + 2048 * 8); cache += 8) {
@@ -36,12 +36,13 @@ static void __no_inline_not_in_flash_func(flushcache)() {
3636
}
3737
__wastedsum += sum;
3838
}
39-
#else
40-
static uint32_t flushcache() {
41-
return 0;
39+
#elif defined(PICO_RP2350)
40+
static void __no_inline_not_in_flash_func(flushcache)() {
41+
// Null
4242
}
4343
#endif
4444

45+
4546
extern "C" {
4647
extern void __real_flash_range_erase(uint32_t flash_offs, size_t count);
4748
void __wrap_flash_range_erase(uint32_t flash_offs, size_t count) {

0 commit comments

Comments
 (0)