drivers/mtd_sdard : Add MACRO and CONFIG_
Replace MTD_SDCARD_SKIP_ERASE with MTD_SDCARD_ERASE Add CONFIG_ Prefix to MTD_SDCARD_ERASE Model CONFIG_MTD_SDCARD_ERASE as bool
This commit is contained in:
parent
3c03394e1e
commit
854145c884
@ -49,15 +49,16 @@ typedef struct {
|
|||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @brief Enable Skip SDCard Erase
|
* @brief Enable SDCard Erase
|
||||||
* @note SDCards handle sector erase internally so it's
|
* @note SDCards handle sector erase internally so it's
|
||||||
* possible to directly write to the card without erasing
|
* possible to directly write to the card without erasing
|
||||||
* the sector first.
|
* the sector first.
|
||||||
* Attention: an erase call will therefore NOT touch the content,
|
* Attention: an erase call will therefore NOT touch the content,
|
||||||
* so disable this feature to ensure overriding the data.
|
* so enable this feature to ensure overriding the data.
|
||||||
|
* This feature is currently not supported.
|
||||||
*/
|
*/
|
||||||
#ifndef MTD_SDCARD_SKIP_ERASE
|
#ifdef DOXYGEN
|
||||||
#define MTD_SDCARD_SKIP_ERASE (1)
|
#define CONFIG_MTD_SDCARD_ERASE
|
||||||
#endif
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,7 @@
|
|||||||
#include "mtd_sdcard.h"
|
#include "mtd_sdcard.h"
|
||||||
#include "sdcard_spi.h"
|
#include "sdcard_spi.h"
|
||||||
#include "sdcard_spi_internal.h"
|
#include "sdcard_spi_internal.h"
|
||||||
|
#include "kernel_defines.h"
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -103,11 +104,12 @@ static int mtd_sdcard_erase(mtd_dev_t *dev,
|
|||||||
(void)addr;
|
(void)addr;
|
||||||
(void)size;
|
(void)size;
|
||||||
|
|
||||||
#if MTD_SDCARD_SKIP_ERASE == 1
|
if (!IS_ACTIVE(CONFIG_MTD_SDCARD_ERASE)) {
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
}
|
||||||
return -ENOTSUP; /* explicit erase currently not supported */
|
else {
|
||||||
#endif
|
return -ENOTSUP; /* explicit erase currently not supported */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mtd_sdcard_power(mtd_dev_t *dev, enum mtd_power_state power)
|
static int mtd_sdcard_power(mtd_dev_t *dev, enum mtd_power_state power)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user