您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ExFatDbgDmp.ino 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include "SdFat.h"
  2. #define DUMP_RAW 0
  3. #define DUMP_UPCASE 0
  4. const uint8_t CS_PIN = SS;
  5. //#define SD_CONFIG SdioConfig(FIFO_SDIO)
  6. #define SD_CONFIG SdSpiConfig(CS_PIN)
  7. SdExFat sd;
  8. #define error(s) sd.errorHalt(&Serial, F(s))
  9. void setup() {
  10. Serial.begin(9600);
  11. while (!Serial) {yield();}
  12. Serial.println(F("Type any character to begin"));
  13. while (!Serial.available()) {yield();}
  14. if (!sd.begin(SD_CONFIG)){
  15. error("begin failed");
  16. }
  17. #if DUMP_RAW
  18. sd.dmpSector(&Serial, 0);
  19. for (uint8_t i = 0; i < 24; i++) {
  20. sd.dmpSector(&Serial, 0X8000 + i);
  21. Serial.println();
  22. }
  23. return;
  24. #endif // DUMP_RAW
  25. ExFatFile root;
  26. if (!root.openRoot(&sd)) {
  27. error("openRoot failed");
  28. }
  29. sd.printDir(&Serial, &root);
  30. // startSector = 0, sectorCount = 1.
  31. sd.dmpFat(&Serial, 0, 1);
  32. sd.dmpBitmap(&Serial);
  33. sd.printVolInfo(&Serial);
  34. sd.checkUpcase(&Serial);
  35. #if DUMP_UPCASE
  36. sd.printUpcase(&Serial);
  37. #endif // DUMP_UPCASE
  38. // sd.dmpCluster(&Serial, 8, 0, 4);
  39. Serial.println("Done");
  40. }
  41. void loop() {
  42. // put your main code here, to run repeatedly:
  43. }