File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 2525#endif
2626
2727#if defined(PICO_RP2350) && defined(RP2350_PSRAM_CS)
28- static volatile uint32_t __wastedsum = 0 ;
2928static void __no_inline_not_in_flash_func (flushcache)() {
30- // for (volatile uint8_t* cache = (volatile uint8_t*)0x18000001; cache < (volatile uint8_t*)(0x18000001 + 2048 * 8); cache += 8) {
31- // *cache = 0;
32- // }
33- uint32_t sum = 0 ; // Ignored, just to ensure not optimized out
34- for (volatile uint32_t *flash = (volatile uint32_t *)0x11000000 ; flash < (volatile uint32_t *)(0x11000000 + 48 * 1024 * 4 ); flash++) {
35- sum += *flash;
29+ for (volatile uint8_t * cache = (volatile uint8_t *)0x18000001 ; cache < (volatile uint8_t *)(0x18000001 + 2048 * 8 ); cache += 8 ) {
30+ *cache = 0 ;
31+ __compiler_memory_barrier ();
32+ *(cache - 1 ) = 0 ;
33+ __compiler_memory_barrier ();
3634 }
37- __wastedsum += sum;
3835}
3936#elif defined(PICO_RP2350)
4037static void __no_inline_not_in_flash_func (flushcache)() {
You can’t perform that action at this time.
0 commit comments