1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +03:00

SDCard - Basic functionality.

Detect card, query capacity, read data.
This commit is contained in:
Dominic Clifton 2015-08-26 01:26:26 +01:00 committed by borisbstyle
parent b1ba72c162
commit 4b955f09da
7 changed files with 1481 additions and 0 deletions

View file

@ -49,6 +49,7 @@
#include "drivers/bus_spi.h"
#include "drivers/inverter.h"
#include "drivers/flash_m25p16.h"
#include "drivers/sdcard.h"
#include "drivers/sonar_hcsr04.h"
#include "drivers/gyro_sync.h"
@ -343,6 +344,19 @@ void init(void)
#endif
#endif
SD_Error error;
SD_Detect_LowLevel_Init();
if (SD_Detect() == SD_PRESENT) {
while ((error = SD_Init()) != SD_RESPONSE_NO_ERROR) {
};
SD_DeInit();
}
SD_Detect_LowLevel_DeInit();
#ifdef USE_HARDWARE_REVISION_DETECTION
updateHardwareRevision();
#endif
@ -477,6 +491,10 @@ void init(void)
}
#endif
#ifdef USE_SD_CARD
SD_Detect_LowLevel_Init();
#endif
#ifdef USE_FLASHFS
#ifdef NAZE
if (hardwareRevision == NAZE32_REV5) {