Skip to content
Snippets Groups Projects
Commit a8c446c3 authored by teemuatlut's avatar teemuatlut Committed by Scott Lahteine
Browse files

[2.0.x]DUE: Fix includes for SDSUPPORT (#9112)

parent cf654b9a
Branches
Tags
No related merge requests found
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#define _CONF_ACCESS_H_ #define _CONF_ACCESS_H_
#include "compiler.h" #include "compiler.h"
#include "../../../inc/MarlinConfigPre.h"
/*! \name Activation of Logical Unit Numbers /*! \name Activation of Logical Unit Numbers
*/ */
......
...@@ -2,9 +2,12 @@ ...@@ -2,9 +2,12 @@
* Interface from Atmel USB MSD to Marlin SD card * Interface from Atmel USB MSD to Marlin SD card
*/ */
#if defined(ARDUINO_ARCH_SAM) && defined(SDSUPPORT) #ifdef ARDUINO_ARCH_SAM
#include "../../../inc/MarlinConfig.h" #include "../../../inc/MarlinConfig.h"
#if ENABLED(SDSUPPORT)
#include "../../../sd/cardreader.h" #include "../../../sd/cardreader.h"
extern "C" { extern "C" {
#include "sd_mmc_spi_mem.h" #include "sd_mmc_spi_mem.h"
...@@ -12,37 +15,31 @@ extern "C" { ...@@ -12,37 +15,31 @@ extern "C" {
#define SD_MMC_BLOCK_SIZE 512 #define SD_MMC_BLOCK_SIZE 512
void sd_mmc_spi_mem_init(void) void sd_mmc_spi_mem_init(void) {
{
} }
Ctrl_status sd_mmc_spi_test_unit_ready(void) Ctrl_status sd_mmc_spi_test_unit_ready(void) {
{
if (!IS_SD_INSERTED || IS_SD_PRINTING || IS_SD_FILE_OPEN || !card.cardOK) if (!IS_SD_INSERTED || IS_SD_PRINTING || IS_SD_FILE_OPEN || !card.cardOK)
return CTRL_NO_PRESENT; return CTRL_NO_PRESENT;
return CTRL_GOOD; return CTRL_GOOD;
} }
Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) Ctrl_status sd_mmc_spi_read_capacity(uint32_t *nb_sector) {
{
if (!IS_SD_INSERTED || IS_SD_PRINTING || IS_SD_FILE_OPEN || !card.cardOK) if (!IS_SD_INSERTED || IS_SD_PRINTING || IS_SD_FILE_OPEN || !card.cardOK)
return CTRL_NO_PRESENT; return CTRL_NO_PRESENT;
*nb_sector = card.getSd2Card().cardSize(); *nb_sector = card.getSd2Card().cardSize();
return CTRL_GOOD; return CTRL_GOOD;
} }
bool sd_mmc_spi_unload(bool unload) bool sd_mmc_spi_unload(bool unload) {
{
return true; return true;
} }
bool sd_mmc_spi_wr_protect(void) bool sd_mmc_spi_wr_protect(void) {
{
return false; return false;
} }
bool sd_mmc_spi_removal(void) bool sd_mmc_spi_removal(void) {
{
if (!IS_SD_INSERTED || IS_SD_PRINTING || IS_SD_FILE_OPEN || !card.cardOK) if (!IS_SD_INSERTED || IS_SD_PRINTING || IS_SD_FILE_OPEN || !card.cardOK)
return true; return true;
return false; return false;
...@@ -61,8 +58,7 @@ uint8_t sector_buf[SD_MMC_BLOCK_SIZE]; ...@@ -61,8 +58,7 @@ uint8_t sector_buf[SD_MMC_BLOCK_SIZE];
// #define DEBUG_MMC // #define DEBUG_MMC
Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) {
{
if (!IS_SD_INSERTED || IS_SD_PRINTING || IS_SD_FILE_OPEN || !card.cardOK) if (!IS_SD_INSERTED || IS_SD_PRINTING || IS_SD_FILE_OPEN || !card.cardOK)
return CTRL_NO_PRESENT; return CTRL_NO_PRESENT;
...@@ -96,8 +92,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector) ...@@ -96,8 +92,7 @@ Ctrl_status sd_mmc_spi_usb_read_10(uint32_t addr, uint16_t nb_sector)
return CTRL_GOOD; return CTRL_GOOD;
} }
Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) {
{
if (!IS_SD_INSERTED || IS_SD_PRINTING || IS_SD_FILE_OPEN || !card.cardOK) if (!IS_SD_INSERTED || IS_SD_PRINTING || IS_SD_FILE_OPEN || !card.cardOK)
return CTRL_NO_PRESENT; return CTRL_NO_PRESENT;
...@@ -132,4 +127,5 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector) ...@@ -132,4 +127,5 @@ Ctrl_status sd_mmc_spi_usb_write_10(uint32_t addr, uint16_t nb_sector)
#endif // ACCESS_USB == true #endif // ACCESS_USB == true
#endif #endif // SDSUPPORT
\ No newline at end of file #endif // ARDUINO_ARCH_SAM
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment