diff options
author | David Crocker <dcrocker@eschertech.com> | 2022-04-29 19:17:41 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2022-04-29 19:17:41 +0300 |
commit | 2b9362496df17b3e0bf63ee76256f4a7eeaba2e6 (patch) | |
tree | 755cfe225050ae9460e131aa3931c79938d2aa4a /src | |
parent | dd5b6b102a45f579671f317a786f4e0af7ce0841 (diff) |
Support SDHC0 as an alternative to SDHC1 in SAME5cx builds
Diffstat (limited to 'src')
-rw-r--r-- | src/Config/Pins_Duet3Mini.h | 2 | ||||
-rw-r--r-- | src/Config/Pins_FMDC.h | 19 | ||||
-rw-r--r-- | src/Libraries/sd_mmc/ctrl_access.cpp | 12 | ||||
-rw-r--r-- | src/Libraries/sd_mmc/sd_mmc.cpp | 86 | ||||
-rw-r--r-- | src/Libraries/sd_mmc/sd_mmc_mem.cpp | 8 |
5 files changed, 62 insertions, 65 deletions
diff --git a/src/Config/Pins_Duet3Mini.h b/src/Config/Pins_Duet3Mini.h index 185ea3e0..188c7f79 100644 --- a/src/Config/Pins_Duet3Mini.h +++ b/src/Config/Pins_Duet3Mini.h @@ -211,7 +211,7 @@ constexpr Pin SdWriteProtectPins[NumSdCards] = { NoPin, NoPin }; constexpr Pin SdSpiCSPins[NumSdCards - 1] = { PortCPin(14) }; constexpr Pin SdMciPins[] = { PortAPin(20), PortAPin(21), PortBPin(18), PortBPin(19), PortBPin(20), PortBPin(21) }; constexpr GpioPinFunction SdMciPinsFunction = GpioPinFunction::I; -Sdhc * const SdDevice = SDHC1; +Sdhc * const SdhcDevice = SDHC1; constexpr IRQn_Type SdhcIRQn = SDHC1_IRQn; constexpr uint32_t ExpectedSdCardSpeed = 15000000; diff --git a/src/Config/Pins_FMDC.h b/src/Config/Pins_FMDC.h index 168f9c46..bcaa82e3 100644 --- a/src/Config/Pins_FMDC.h +++ b/src/Config/Pins_FMDC.h @@ -51,6 +51,7 @@ constexpr uint32_t IAP_IMAGE_START = 0x20028000; #define SUPPORT_DHT_SENSOR 1 // set nonzero to support DHT temperature/humidity sensors (requires RTOS) #define SUPPORT_WORKPLACE_COORDINATES 1 // set nonzero to support G10 L2 and G53..59 #define SUPPORT_12864_LCD 0 // set nonzero to support 12864 LCD and rotary encoder +#define SUPPORT_TFTM0356_6_LCD 1 #define SUPPORT_ACCELEROMETERS 1 #define SUPPORT_OBJECT_MODEL 1 #define SUPPORT_FTP 0 @@ -189,13 +190,6 @@ constexpr bool DiagOnPolarity = false; constexpr bool ActOnPolarity = false; // SD cards -#if !HAS_HIGH_SPEED_SD //TEMP!! -constexpr size_t NumSdCards = 1; -constexpr Pin SdCardDetectPins[NumSdCards] = { /*PortBPin(0)*/ NoPin }; - -constexpr Pin SdWriteProtectPins[NumSdCards] = { NoPin }; -constexpr Pin SdSpiCSPins[NumSdCards - HAS_HIGH_SPEED_SD] = { PortCPin(14) }; -#else constexpr size_t NumSdCards = 2; constexpr Pin SdCardDetectPins[NumSdCards] = { PortBPin(16), /*PortBPin(0)*/ NoPin }; @@ -203,12 +197,12 @@ constexpr Pin SdWriteProtectPins[NumSdCards] = { NoPin, NoPin }; constexpr Pin SdSpiCSPins[NumSdCards - HAS_HIGH_SPEED_SD] = { PortCPin(14) }; constexpr Pin SdMciPins[] = { PortAPin(20), PortAPin(21), PortBPin(18), PortBPin(19), PortBPin(20), PortBPin(21) }; constexpr GpioPinFunction SdMciPinsFunction = GpioPinFunction::I; -Sdhc * const SdDevice = SDHC1; +Sdhc * const SdhcDevice = SDHC1; constexpr IRQn_Type SdhcIRQn = SDHC1_IRQn; constexpr uint32_t ExpectedSdCardSpeed = 15000000; -#endif // LCD interface +constexpr uint32_t LcdSpiClockFrequency = 4000000; // 4.0MHz constexpr unsigned int LcdSercomNumber = 0; constexpr Pin LcdSpiMosiPin = PortAPin(4); constexpr Pin LcdSpiMisoPin = PortAPin(7); @@ -231,6 +225,9 @@ constexpr Pin RtpSpiSclkPin = PortCPin(17); constexpr Pin RtpSpiCsPin = PortCPin(18); constexpr GpioPinFunction RtpSpiPinFunction = GpioPinFunction::C; +// Beeper +constexpr Pin BeeperPins[2] = { PortAPin(8), PortAPin(9) }; + // Shared SPI definitions constexpr uint8_t SharedSpiSercomNumber = 7; constexpr Pin SharedSpiMosiPin = PortCPin(12); @@ -299,8 +296,8 @@ constexpr PinDescription PinTable[] = { TcOutput::none, TccOutput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, PinCapability::none, nullptr }, // PA05 LCD SCLK { TcOutput::none, TccOutput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, PinCapability::none, nullptr }, // PA06 LCD CS { TcOutput::none, TccOutput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, PinCapability::none, nullptr }, // PA07 LCD MOSI - { TcOutput::none, TccOutput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, PinCapability::none, nullptr }, // PA08 Buzzer A - { TcOutput::tc0_1, TccOutput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, PinCapability::none, nullptr }, // PA09 Buzzer B + { TcOutput::none, TccOutput::tcc0_0F, AdcInput::none, SercomIo::none, SercomIo::none, Nx, PinCapability::none, nullptr }, // PA08 Buzzer A + { TcOutput::none, TccOutput::tcc0_1F, AdcInput::none, SercomIo::none, SercomIo::none, Nx, PinCapability::none, nullptr }, // PA09 Buzzer B { TcOutput::none, TccOutput::none, AdcInput::none, SercomIo::none, SercomIo::none, 10, PinCapability::none, "ate.d0.diag" }, // PA10 driver 0 diag { TcOutput::tc1_1, TccOutput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, PinCapability::wpwm, "out4" }, // PA11 OUT4 { TcOutput::none, TccOutput::none, AdcInput::none, SercomIo::none, SercomIo::none, Nx, PinCapability::none, nullptr }, // PA12 WiFi SCLK (SERCOM4.1) diff --git a/src/Libraries/sd_mmc/ctrl_access.cpp b/src/Libraries/sd_mmc/ctrl_access.cpp index 3ed468d0..7932c73d 100644 --- a/src/Libraries/sd_mmc/ctrl_access.cpp +++ b/src/Libraries/sd_mmc/ctrl_access.cpp @@ -63,22 +63,22 @@ #include "sd_mmc_mem.h" -Ctrl_status mem_test_unit_ready(uint8_t lun) +Ctrl_status mem_test_unit_ready(uint8_t lun) noexcept { return (lun < MAX_LUN) ? sd_mmc_test_unit_ready(lun) : CTRL_FAIL; } -Ctrl_status mem_read_capacity(uint8_t lun, uint32_t *u32_nb_sector) +Ctrl_status mem_read_capacity(uint8_t lun, uint32_t *u32_nb_sector) noexcept { return (lun < MAX_LUN) ? sd_mmc_read_capacity(lun, u32_nb_sector) : CTRL_FAIL; } -uint8_t mem_sector_size(uint8_t lun) +uint8_t mem_sector_size(uint8_t lun) noexcept { return 1; } -bool mem_wr_protect(uint8_t lun) +bool mem_wr_protect(uint8_t lun) noexcept { #if SUPPORT_WRITE_PROTECT return (lun >= MAX_LUN) || sd_mmc_wr_protect(lun)e; @@ -87,12 +87,12 @@ bool mem_wr_protect(uint8_t lun) #endif } -Ctrl_status memory_2_ram(uint8_t lun, uint32_t addr, void *ram, uint32_t numBlocks) +Ctrl_status memory_2_ram(uint8_t lun, uint32_t addr, void *ram, uint32_t numBlocks) noexcept { return (lun < MAX_LUN) ? sd_mmc_mem_2_ram(lun, addr, ram, numBlocks) : CTRL_FAIL; } -Ctrl_status ram_2_memory(uint8_t lun, uint32_t addr, const void *ram, uint32_t numBlocks) +Ctrl_status ram_2_memory(uint8_t lun, uint32_t addr, const void *ram, uint32_t numBlocks) noexcept { return (lun < MAX_LUN) ? sd_mmc_ram_2_mem(lun, addr, ram, numBlocks) : CTRL_FAIL; } diff --git a/src/Libraries/sd_mmc/sd_mmc.cpp b/src/Libraries/sd_mmc/sd_mmc.cpp index 11d0cd75..baccd68d 100644 --- a/src/Libraries/sd_mmc/sd_mmc.cpp +++ b/src/Libraries/sd_mmc/sd_mmc.cpp @@ -47,8 +47,8 @@ // 2021-02-03: MC and DC converted this to be re-entrant, provided that only one task uses each interface. // Currently all RRF configurations for Duets support at most one HSMCI and one SPI card, and there is a mutex for each volume, so this is the case. -#include <Core.h> // for digitalRead() and pinMode() -#include <string.h> +#include <RepRapFirmware.h> +#include <cstring> #define SUPPORT_SDHC 1 @@ -82,27 +82,27 @@ extern void debugPrintf(const char* fmt, ...); # error SD_MMC_SPI_MEM_CNT not defined #endif -typedef void (*driverIdleFunc_t)(uint32_t, uint32_t); +typedef void (*driverIdleFunc_t)(uint32_t, uint32_t) noexcept; struct DriverInterface { - bool (*select_device)(uint8_t slot, uint32_t clock, uint8_t bus_width, bool high_speed); - void (*deselect_device)(uint8_t slot); - uint8_t (*get_bus_width)(uint8_t slot); - bool (*is_high_speed_capable)(void); - void (*send_clock)(void); - bool (*send_cmd)(sdmmc_cmd_def_t cmd, uint32_t arg); - uint32_t (*get_response)(void); - void (*get_response_128)(uint8_t* response); - bool (*adtc_start)(sdmmc_cmd_def_t cmd, uint32_t arg, uint16_t block_size, uint16_t nb_block, const void* dmaAddr); - bool (*adtc_stop)(sdmmc_cmd_def_t cmd, uint32_t arg); - bool (*read_word)(uint32_t* value); - bool (*write_word)(uint32_t value); - bool (*start_read_blocks)(void *dest, uint16_t nb_block); - bool (*wait_end_of_read_blocks)(void); - bool (*start_write_blocks)(const void *src, uint16_t nb_block); - bool (*wait_end_of_write_blocks)(void); - uint32_t (*getInterfaceSpeed)(void); + bool (*select_device)(uint8_t slot, uint32_t clock, uint8_t bus_width, bool high_speed) noexcept; + void (*deselect_device)(uint8_t slot) noexcept; + uint8_t (*get_bus_width)(uint8_t slot) noexcept; + bool (*is_high_speed_capable)(void) noexcept; + void (*send_clock)(void) noexcept; + bool (*send_cmd)(sdmmc_cmd_def_t cmd, uint32_t arg) noexcept; + uint32_t (*get_response)(void) noexcept; + void (*get_response_128)(uint8_t* response) noexcept; + bool (*adtc_start)(sdmmc_cmd_def_t cmd, uint32_t arg, uint16_t block_size, uint16_t nb_block, const void* dmaAddr) noexcept; + bool (*adtc_stop)(sdmmc_cmd_def_t cmd, uint32_t arg) noexcept; + bool (*read_word)(uint32_t* value) noexcept; + bool (*write_word)(uint32_t value) noexcept; + bool (*start_read_blocks)(void *dest, uint16_t nb_block) noexcept; + bool (*wait_end_of_read_blocks)(void) noexcept; + bool (*start_write_blocks)(const void *src, uint16_t nb_block) noexcept; + bool (*wait_end_of_write_blocks)(void) noexcept; + uint32_t (*getInterfaceSpeed)(void) noexcept; driverIdleFunc_t (*set_idle_func)(driverIdleFunc_t); bool is_spi; // true if the interface is SPI, false if it is HSMCI }; @@ -928,7 +928,7 @@ static bool mmc_cmd8(uint8_t *b_authorize_high_speed, uint8_t slot) uint32_t sec_count; struct sd_mmc_card * const sd_mmc_card = &sd_mmc_cards[slot]; - if (!sd_mmc_card->iface->adtc_start(MMC_CMD8_SEND_EXT_CSD, 0, EXT_CSD_BSIZE, 1, false)) { + if (!sd_mmc_card->iface->adtc_start(MMC_CMD8_SEND_EXT_CSD, 0, EXT_CSD_BSIZE, 1, nullptr)) { return false; } //** Read and decode Extended Extended CSD @@ -1796,7 +1796,7 @@ static bool sd_mmc_mci_install_mmc(uint8_t slot) //------------------------------------------------------------------- //--------------------- PUBLIC FUNCTIONS ---------------------------- -void sd_mmc_init(const Pin wpPins[], const Pin spiCsPins[]) +void sd_mmc_init(const Pin wpPins[], const Pin spiCsPins[]) noexcept { for (size_t slot = 0; slot < SD_MMC_MEM_CNT; slot++) { @@ -1827,7 +1827,11 @@ void sd_mmc_init(const Pin wpPins[], const Pin spiCsPins[]) // sd_mmc_slot_sel = 0xFF; // No slot selected #if SD_MMC_HSMCI_MEM_CNT != 0 +# if SAME5x + hsmci_init(SdhcDevice, SdhcIRQn); +# else hsmci_init(); +# endif #endif #if SD_MMC_SPI_MEM_CNT != 0 @@ -1835,14 +1839,14 @@ void sd_mmc_init(const Pin wpPins[], const Pin spiCsPins[]) #endif } -uint8_t sd_mmc_nb_slot(void) +uint8_t sd_mmc_nb_slot(void) noexcept { return SD_MMC_MEM_CNT; } // Check that the card is ready and initialise it if necessary // The card is not selected on entry or at exit -sd_mmc_err_t sd_mmc_check(uint8_t slot) +sd_mmc_err_t sd_mmc_check(uint8_t slot) noexcept { sd_mmc_err_t sd_mmc_err = sd_mmc_select_slot(slot); if (sd_mmc_err != SD_MMC_INIT_ONGOING) @@ -1867,7 +1871,7 @@ sd_mmc_err_t sd_mmc_check(uint8_t slot) return SD_MMC_ERR_UNUSABLE; } -card_type_t sd_mmc_get_type(uint8_t slot) +card_type_t sd_mmc_get_type(uint8_t slot) noexcept { if (SD_MMC_OK != sd_mmc_select_slot(slot)) { return CARD_TYPE_UNKNOWN; @@ -1876,7 +1880,7 @@ card_type_t sd_mmc_get_type(uint8_t slot) return sd_mmc_cards[slot].type; } -card_version_t sd_mmc_get_version(uint8_t slot) +card_version_t sd_mmc_get_version(uint8_t slot) noexcept { if (SD_MMC_OK != sd_mmc_select_slot(slot)) { return CARD_VER_UNKNOWN; @@ -1885,7 +1889,7 @@ card_version_t sd_mmc_get_version(uint8_t slot) return sd_mmc_cards[slot].version; } -uint32_t sd_mmc_get_capacity(uint8_t slot) +uint32_t sd_mmc_get_capacity(uint8_t slot) noexcept { #if 1 // This will only check for already present data. The old code below is unsafe if another task is accessing data already. if (slot < SD_MMC_MEM_CNT && sd_mmc_cards[slot].state == SD_MMC_CARD_STATE_READY) @@ -1915,13 +1919,13 @@ bool sd_mmc_is_write_protected(uint8_t slot) #if 1 // dc42 // Unmount the card. Must call this to force it to be re-initialised when changing card. -void sd_mmc_unmount(uint8_t slot) +void sd_mmc_unmount(uint8_t slot) noexcept { sd_mmc_cards[slot].state = SD_MMC_CARD_STATE_NO_CARD; } // Get the interface speed in bytes/sec -uint32_t sd_mmc_get_interface_speed(uint8_t slot) +uint32_t sd_mmc_get_interface_speed(uint8_t slot) noexcept { return sd_mmc_cards[slot].iface->getInterfaceSpeed(); } @@ -1944,7 +1948,7 @@ void sd_mmc_change_cs_pin(uint8_t slot, Pin csPin) noexcept // Initialise for reading blocks // On entry the card is not selected // If SD_MMC_OK is returned then the card is selected, otherwise it is not selected -sd_mmc_err_t sd_mmc_init_read_blocks(uint8_t slot, uint32_t start, uint16_t nb_block, void *dmaAddr) +sd_mmc_err_t sd_mmc_init_read_blocks(uint8_t slot, uint32_t start, uint16_t nb_block, void *dmaAddr) noexcept { sd_mmc_err_t sd_mmc_err; uint32_t cmd, arg, resp; @@ -2000,7 +2004,7 @@ sd_mmc_err_t sd_mmc_init_read_blocks(uint8_t slot, uint32_t start, uint16_t nb_b // Start reading blocks // On entry the card is selected // If SD_MMC_OK is returned then the card is selected, otherwise it is not selected -sd_mmc_err_t sd_mmc_start_read_blocks(void *dest, uint16_t nb_block, uint8_t slot) +sd_mmc_err_t sd_mmc_start_read_blocks(void *dest, uint16_t nb_block, uint8_t slot) noexcept { Assert(sd_mmc_nb_block_remaining[slot] >= nb_block); @@ -2017,7 +2021,7 @@ sd_mmc_err_t sd_mmc_start_read_blocks(void *dest, uint16_t nb_block, uint8_t slo // Wait until all blocks have been read // On entry the device is selected // On return it is not selected -sd_mmc_err_t sd_mmc_wait_end_of_read_blocks(bool abort, uint8_t slot) +sd_mmc_err_t sd_mmc_wait_end_of_read_blocks(bool abort, uint8_t slot) noexcept { struct sd_mmc_card * const sd_mmc_card = &sd_mmc_cards[slot]; if (!sd_mmc_card->iface->wait_end_of_read_blocks()) { @@ -2050,7 +2054,7 @@ sd_mmc_err_t sd_mmc_wait_end_of_read_blocks(bool abort, uint8_t slot) // Initialise for writing blocks // On entry the card is not selected // If SD_MMC_OK is returned then the card is selected, otherwise it is not selected -sd_mmc_err_t sd_mmc_init_write_blocks(uint8_t slot, uint32_t start, uint16_t nb_block, const void *dmaAddr) +sd_mmc_err_t sd_mmc_init_write_blocks(uint8_t slot, uint32_t start, uint16_t nb_block, const void *dmaAddr) noexcept { sd_mmc_err_t sd_mmc_err; uint32_t cmd, arg, resp; @@ -2106,7 +2110,7 @@ sd_mmc_err_t sd_mmc_init_write_blocks(uint8_t slot, uint32_t start, uint16_t nb_ // Start writing blocks // On entry the card is selected // If SD_MMC_OK is returned then the card is selected, otherwise it is not selected -sd_mmc_err_t sd_mmc_start_write_blocks(const void *src, uint16_t nb_block, uint8_t slot) +sd_mmc_err_t sd_mmc_start_write_blocks(const void *src, uint16_t nb_block, uint8_t slot) noexcept { Assert(sd_mmc_nb_block_remaining[slot] >= nb_block); struct sd_mmc_card * const sd_mmc_card = &sd_mmc_cards[slot]; @@ -2122,7 +2126,7 @@ sd_mmc_err_t sd_mmc_start_write_blocks(const void *src, uint16_t nb_block, uint8 // Wait until all blocks have been written // On entry the device is selected // On return it is not selected -sd_mmc_err_t sd_mmc_wait_end_of_write_blocks(bool abort, uint8_t slot) +sd_mmc_err_t sd_mmc_wait_end_of_write_blocks(bool abort, uint8_t slot) noexcept { struct sd_mmc_card * const sd_mmc_card = &sd_mmc_cards[slot]; if (!sd_mmc_card->iface->wait_end_of_write_blocks()) { @@ -2156,8 +2160,7 @@ sd_mmc_err_t sd_mmc_wait_end_of_write_blocks(bool abort, uint8_t slot) } #ifdef SDIO_SUPPORT_ENABLE -sd_mmc_err_t sdio_read_direct(uint8_t slot, uint8_t func_num, uint32_t addr, - uint8_t *dest) +sd_mmc_err_t sdio_read_direct(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t *dest) noexcept { sd_mmc_err_t sd_mmc_err; @@ -2178,8 +2181,7 @@ sd_mmc_err_t sdio_read_direct(uint8_t slot, uint8_t func_num, uint32_t addr, return SD_MMC_OK; } -sd_mmc_err_t sdio_write_direct(uint8_t slot, uint8_t func_num, uint32_t addr, - uint8_t data) +sd_mmc_err_t sdio_write_direct(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t data) noexcept { sd_mmc_err_t sd_mmc_err; @@ -2197,8 +2199,7 @@ sd_mmc_err_t sdio_write_direct(uint8_t slot, uint8_t func_num, uint32_t addr, return SD_MMC_OK; } -sd_mmc_err_t sdio_read_extended(uint8_t slot, uint8_t func_num, uint32_t addr, - uint8_t inc_addr, uint8_t *dest, uint16_t size) +sd_mmc_err_t sdio_read_extended(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t inc_addr, uint8_t *dest, uint16_t size) noexcept { sd_mmc_err_t sd_mmc_err; @@ -2229,8 +2230,7 @@ sd_mmc_err_t sdio_read_extended(uint8_t slot, uint8_t func_num, uint32_t addr, return SD_MMC_OK; } -sd_mmc_err_t sdio_write_extended(uint8_t slot, uint8_t func_num, uint32_t addr, - uint8_t inc_addr, uint8_t *src, uint16_t size) +sd_mmc_err_t sdio_write_extended(uint8_t slot, uint8_t func_num, uint32_t addr, uint8_t inc_addr, uint8_t *src, uint16_t size) noexcept { sd_mmc_err_t sd_mmc_err; diff --git a/src/Libraries/sd_mmc/sd_mmc_mem.cpp b/src/Libraries/sd_mmc/sd_mmc_mem.cpp index 4789f90f..33a2afb5 100644 --- a/src/Libraries/sd_mmc/sd_mmc_mem.cpp +++ b/src/Libraries/sd_mmc/sd_mmc_mem.cpp @@ -59,7 +59,7 @@ * @{ */ -Ctrl_status sd_mmc_test_unit_ready(uint8_t slot) +Ctrl_status sd_mmc_test_unit_ready(uint8_t slot) noexcept { switch (sd_mmc_check(slot)) { @@ -81,7 +81,7 @@ Ctrl_status sd_mmc_test_unit_ready(uint8_t slot) } } -Ctrl_status sd_mmc_read_capacity(uint8_t slot, uint32_t *nb_sector) +Ctrl_status sd_mmc_read_capacity(uint8_t slot, uint32_t *nb_sector) noexcept { // Return last sector address (-1) *nb_sector = (sd_mmc_get_capacity(slot) * 2) - 1; @@ -99,7 +99,7 @@ bool sd_mmc_wr_protect(uint8_t slot) * \name MEM <-> RAM Interface * @{ */ -Ctrl_status sd_mmc_mem_2_ram(uint8_t slot, uint32_t addr, void *ram, uint32_t numBlocks) +Ctrl_status sd_mmc_mem_2_ram(uint8_t slot, uint32_t addr, void *ram, uint32_t numBlocks) noexcept { switch (sd_mmc_init_read_blocks(slot, addr, numBlocks, ram)) { case SD_MMC_OK: @@ -118,7 +118,7 @@ Ctrl_status sd_mmc_mem_2_ram(uint8_t slot, uint32_t addr, void *ram, uint32_t nu return CTRL_GOOD; } -Ctrl_status sd_mmc_ram_2_mem(uint8_t slot, uint32_t addr, const void *ram, uint32_t numBlocks) +Ctrl_status sd_mmc_ram_2_mem(uint8_t slot, uint32_t addr, const void *ram, uint32_t numBlocks) noexcept { switch (sd_mmc_init_write_blocks(slot, addr, numBlocks, ram)) { case SD_MMC_OK: |