mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 09:16:07 +03:00
Reset the card when a timeout/fault is detected during init/read/write
This commit is contained in:
parent
e572ccebad
commit
392ec7412a
4 changed files with 164 additions and 93 deletions
|
@ -249,12 +249,19 @@ typedef enum {
|
|||
SDCARD_BLOCK_OPERATION_ERASE,
|
||||
} sdcardBlockOperation_e;
|
||||
|
||||
typedef enum {
|
||||
SDCARD_OPERATION_IN_PROGRESS,
|
||||
SDCARD_OPERATION_BUSY,
|
||||
SDCARD_OPERATION_SUCCESS,
|
||||
SDCARD_OPERATION_FAILURE
|
||||
} sdcardOperationStatus_e;
|
||||
|
||||
typedef void(*sdcard_operationCompleteCallback_c)(sdcardBlockOperation_e operation, uint32_t blockIndex, uint8_t *buffer, uint32_t callbackData);
|
||||
|
||||
bool sdcard_init();
|
||||
|
||||
bool sdcard_readBlock(uint32_t blockIndex, uint8_t *buffer, sdcard_operationCompleteCallback_c callback, uint32_t callbackData);
|
||||
bool sdcard_writeBlock(uint32_t blockIndex, uint8_t *buffer, sdcard_operationCompleteCallback_c callback, uint32_t callbackData);
|
||||
sdcardOperationStatus_e sdcard_writeBlock(uint32_t blockIndex, uint8_t *buffer, sdcard_operationCompleteCallback_c callback, uint32_t callbackData);
|
||||
|
||||
void sdcard_poll();
|
||||
bool sdcard_isReady();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue