qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

wear_leveling_rp2040_flash_config.h (989B)


      1 // Copyright 2022 Nick Brassel (@tzarc)
      2 // SPDX-License-Identifier: GPL-2.0-or-later
      3 #pragma once
      4 
      5 #ifndef __ASSEMBLER__
      6 #    include "hardware/flash.h"
      7 #endif
      8 
      9 // 2-byte writes
     10 #ifndef BACKING_STORE_WRITE_SIZE
     11 #    define BACKING_STORE_WRITE_SIZE 2
     12 #endif
     13 
     14 // 64kB backing space allocated
     15 #ifndef WEAR_LEVELING_BACKING_SIZE
     16 #    define WEAR_LEVELING_BACKING_SIZE 8192
     17 #endif // WEAR_LEVELING_BACKING_SIZE
     18 
     19 // 32kB logical EEPROM
     20 #ifndef WEAR_LEVELING_LOGICAL_SIZE
     21 #    define WEAR_LEVELING_LOGICAL_SIZE ((WEAR_LEVELING_BACKING_SIZE) / 2)
     22 #endif // WEAR_LEVELING_LOGICAL_SIZE
     23 
     24 // Define how much flash space we have (defaults to lib/pico-sdk/src/boards/include/boards/***)
     25 #ifndef WEAR_LEVELING_RP2040_FLASH_SIZE
     26 #    define WEAR_LEVELING_RP2040_FLASH_SIZE (PICO_FLASH_SIZE_BYTES)
     27 #endif
     28 
     29 // Define the location of emulated EEPROM
     30 #ifndef WEAR_LEVELING_RP2040_FLASH_BASE
     31 #    define WEAR_LEVELING_RP2040_FLASH_BASE ((WEAR_LEVELING_RP2040_FLASH_SIZE) - (WEAR_LEVELING_BACKING_SIZE))
     32 #endif