Repair dataflash test

This commit is contained in:
Doug Weibel 2012-01-08 21:26:56 -07:00
parent 47197891e3
commit 22d2db53d8
1 changed files with 13 additions and 5 deletions

View File

@ -10,9 +10,14 @@
#define HEAD_BYTE1 0xA3 #define HEAD_BYTE1 0xA3
#define HEAD_BYTE2 0x95 #define HEAD_BYTE2 0x95
// NOTE: You must uncomment one of the following two lines
DataFlash_APM2 DataFlash; // Uncomment this line if using APM2 hardware
//DataFlash_APM1 DataFlash; // Uncomment this line if using APM1 hardware
void setup() void setup()
{ {
Serial.begin(38400); Serial.begin(115200);
DataFlash.Init(); // DataFlash initialization DataFlash.Init(); // DataFlash initialization
Serial.println("Dataflash Log Test 1.0"); Serial.println("Dataflash Log Test 1.0");
@ -24,14 +29,14 @@ void setup()
Serial.print("Manufacturer:"); Serial.print("Manufacturer:");
Serial.print(int(DataFlash.df_manufacturer)); Serial.print(int(DataFlash.df_manufacturer));
Serial.print(","); Serial.print(",");
Serial.print(int(DataFlash.df_device_0)); Serial.print(DataFlash.df_device);
Serial.print(",");
Serial.print(int(DataFlash.df_device_1));
Serial.println(); Serial.println();
// We start to write some info (sequentialy) starting from page 1 // We start to write some info (sequentialy) starting from page 1
// This is similar to what we will do... // This is similar to what we will do...
DataFlash.StartWrite(1); DataFlash.StartWrite(1);
Serial.println("After testing perform erase before using DataFlash for logging!");
Serial.println("");
Serial.println("Writing to flash... wait..."); Serial.println("Writing to flash... wait...");
for (int i = 0; i < 1000; i++){ // Write 1000 packets... for (int i = 0; i < 1000; i++){ // Write 1000 packets...
// We write packets of binary data... (without worry about nothing more) // We write packets of binary data... (without worry about nothing more)
@ -96,5 +101,8 @@ void loop()
} }
Serial.println(); Serial.println();
} }
delay(10000); Serial.println("");
Serial.println("Test complete. Test will repeat in 20 seconds");
Serial.println("");
delay(20000);
} }