Pārlūkot izejas kodu

Detect FAT16 partition type

main
PaulStoffregen pirms 9 gadiem
vecāks
revīzija
4a6c3e7f31
2 mainītis faili ar 3 papildinājumiem un 2 dzēšanām
  1. +1
    -1
      SD_t3.h
  2. +2
    -1
      init_t3.cpp

+ 1
- 1
SD_t3.h Parādīt failu

@@ -27,7 +27,7 @@
// This Teensy 3.x optimized version is a work-in-progress.
// Uncomment this line to use the Teensy version. Otherwise,
// the normal SD library is used.
//#define USE_TEENSY3_OPTIMIZED_CODE
#define USE_TEENSY3_OPTIMIZED_CODE

/* Why reinvent the SD library wheel...
* 1: Allow reading files from within interrupts

+ 2
- 1
init_t3.cpp Parādīt failu

@@ -115,6 +115,7 @@ bool SDClass::begin(uint8_t csPin)
if (msec > 1500) return false;
SPI.beginTransaction(SD_SPI_SPEED);
}
//Serial.println("card is ready");
// detect high capacity cards
if (card_type == 2) {
ocr = sd_cmd58();
@@ -134,7 +135,7 @@ bool SDClass::begin(uint8_t csPin)
do {
uint8_t type = mbr->u8[index+4];
//Serial.printf(" partition %d is type %d\n", (index-446)/16+1, type);
if (type == 11 || type == 12) {
if (type == 6 || type == 11 || type == 12) {
partition_lba = unaligned_read32_align16(mbr->u8 + index + 8);
//Serial.printf(" partition lba = %d\n", partition_lba);
break;

Notiek ielāde…
Atcelt
Saglabāt