mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-26 18:48:30 -04:00
uncrustify libraries/DataFlash/examples/DataFlash_test/DataFlash_test.pde
This commit is contained in:
parent
5d0284c19a
commit
97927f5f5a
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
Example of DataFlash library.
|
* Example of DataFlash library.
|
||||||
Code by Jordi MuÒoz and Jose Julio. DIYDrones.com
|
* Code by Jordi MuÒoz and Jose Julio. DIYDrones.com
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Libraries
|
// Libraries
|
||||||
#include <SPI.h> // Arduino SPI lib
|
#include <SPI.h> // Arduino SPI lib
|
||||||
@ -38,7 +38,7 @@ void setup()
|
|||||||
Serial.println("After testing perform erase before using DataFlash for logging!");
|
Serial.println("After testing perform erase before using DataFlash for logging!");
|
||||||
Serial.println("");
|
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)
|
||||||
DataFlash.WriteByte(HEAD_BYTE1);
|
DataFlash.WriteByte(HEAD_BYTE1);
|
||||||
DataFlash.WriteByte(HEAD_BYTE2);
|
DataFlash.WriteByte(HEAD_BYTE2);
|
||||||
@ -65,14 +65,14 @@ void loop()
|
|||||||
|
|
||||||
DataFlash.StartRead(1); // We start reading from page 1
|
DataFlash.StartRead(1); // We start reading from page 1
|
||||||
|
|
||||||
for (i = 0; i < 200; i++){ // Read 200 packets...
|
for (i = 0; i < 200; i++) { // Read 200 packets...
|
||||||
|
|
||||||
tmp_byte1 = DataFlash.ReadByte();
|
tmp_byte1 = DataFlash.ReadByte();
|
||||||
tmp_byte2 = DataFlash.ReadByte();
|
tmp_byte2 = DataFlash.ReadByte();
|
||||||
|
|
||||||
Serial.print("PACKET:");
|
Serial.print("PACKET:");
|
||||||
|
|
||||||
if ((tmp_byte1 == HEAD_BYTE1) && (tmp_byte1 == HEAD_BYTE1)){
|
if ((tmp_byte1 == HEAD_BYTE1) && (tmp_byte1 == HEAD_BYTE1)) {
|
||||||
// Read 4 ints...
|
// Read 4 ints...
|
||||||
tmp_int = DataFlash.ReadInt();
|
tmp_int = DataFlash.ReadInt();
|
||||||
Serial.print(tmp_int);
|
Serial.print(tmp_int);
|
||||||
|
Loading…
Reference in New Issue
Block a user