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:
parent
b1ba72c162
commit
4b955f09da
7 changed files with 1481 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue