Skip to content

Commit

Permalink
fix examples for express boards to check the SPI define
Browse files Browse the repository at this point in the history
  • Loading branch information
ladyada committed Feb 17, 2019
1 parent 4e6251d commit 4f15bde
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 28 deletions.
3 changes: 2 additions & 1 deletion examples/SPI_Flash_Manipulator/SPI_Flash_Manipulator.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
void PrintHex(const byte * data, const uint32_t numBytes);
#include <Adafruit_SPIFlash.h>

#if !defined(SS1)
#if (SPI_INTERFACES_COUNT == 1)
#define FLASH_SS SS // Flash chip SS pin.
#define FLASH_SPI_PORT SPI // What SPI port is Flash on?
#else
#define FLASH_SS SS1 // Flash chip SS pin.
#define FLASH_SPI_PORT SPI1 // What SPI port is Flash on?
#endif

Adafruit_SPIFlash flash(FLASH_SS, &FLASH_SPI_PORT); // Use hardware SPI

#define SD_CS 2
Expand Down
10 changes: 5 additions & 5 deletions examples/circuitpython_backupFiles/circuitpython_backupFiles.ino
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
// sure to change the fatfs
// object type below to match.

#if !defined(SS1)
#if (SPI_INTERFACES_COUNT == 1)
#define FLASH_SS SS // Flash chip SS pin.
#define FLASH_SPI_PORT SPI // What SPI port is Flash on?
#define NEOPIN 8
#else
#define FLASH_SS SS1 // Flash chip SS pin.
#define FLASH_SPI_PORT SPI1 // What SPI port is Flash on?
#define NEOPIN 40
#endif

#define NEOPIN 40 // neopixel pin

#define BUFFERSIZ 200

Adafruit_SPIFlash flash(FLASH_SS, &FLASH_SPI_PORT); // Use hardware SPI
Expand All @@ -50,7 +50,7 @@ Adafruit_NeoPixel pixel = Adafruit_NeoPixel(1, NEOPIN, NEO_GRB + NEO_KHZ800);

void setup() {
Serial.begin(115200);
while (!Serial);
//while (!Serial);
delay(1000); // small delay in case we want to watch it on the serial port
Serial.println("Adafruit Express CircuitPython Flash Repair");

Expand Down Expand Up @@ -169,4 +169,4 @@ void error(uint8_t i) {
}
delay(1000);
}
}
}
5 changes: 2 additions & 3 deletions examples/fatfs_circuitpython/fatfs_circuitpython.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,15 @@
// sure to change the fatfs
// object type below to match.

#if !defined(SS1)
#if (SPI_INTERFACES_COUNT == 1)
#define FLASH_SS SS // Flash chip SS pin.
#define FLASH_SPI_PORT SPI // What SPI port is Flash on?
#define NEOPIN 8
#else
#define FLASH_SS SS1 // Flash chip SS pin.
#define FLASH_SPI_PORT SPI1 // What SPI port is Flash on?
#define NEOPIN 40
#endif


Adafruit_SPIFlash flash(FLASH_SS, &FLASH_SPI_PORT); // Use hardware SPI

// Alternatively you can define and use non-SPI pins!
Expand Down
5 changes: 2 additions & 3 deletions examples/fatfs_datalogging/fatfs_datalogging.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@
// sure to change the fatfs
// object type below to match.

#if !defined(SS1)
#if (SPI_INTERFACES_COUNT == 1)
#define FLASH_SS SS // Flash chip SS pin.
#define FLASH_SPI_PORT SPI // What SPI port is Flash on?
#define NEOPIN 8
#else
#define FLASH_SS SS1 // Flash chip SS pin.
#define FLASH_SPI_PORT SPI1 // What SPI port is Flash on?
#define NEOPIN 40
#endif


Adafruit_SPIFlash flash(FLASH_SS, &FLASH_SPI_PORT); // Use hardware SPI

// Alternatively you can define and use non-SPI pins!
Expand Down
4 changes: 1 addition & 3 deletions examples/fatfs_format/fatfs_format.ino
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@
// sure to change the fatfs
// object type below to match.

#if !defined(SS1)
#if (SPI_INTERFACES_COUNT == 1)
#define FLASH_SS SS // Flash chip SS pin.
#define FLASH_SPI_PORT SPI // What SPI port is Flash on?
#define NEOPIN 8
#else
#define FLASH_SS SS1 // Flash chip SS pin.
#define FLASH_SPI_PORT SPI1 // What SPI port is Flash on?
#define NEOPIN 40
#endif

Adafruit_SPIFlash flash(FLASH_SS, &FLASH_SPI_PORT); // Use hardware SPI
Expand Down
5 changes: 2 additions & 3 deletions examples/fatfs_full_usage/fatfs_full_usage.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,15 @@
// sure to change the fatfs
// object type below to match.

#if !defined(SS1)
#if (SPI_INTERFACES_COUNT == 1)
#define FLASH_SS SS // Flash chip SS pin.
#define FLASH_SPI_PORT SPI // What SPI port is Flash on?
#define NEOPIN 8
#else
#define FLASH_SS SS1 // Flash chip SS pin.
#define FLASH_SPI_PORT SPI1 // What SPI port is Flash on?
#define NEOPIN 40
#endif


Adafruit_SPIFlash flash(FLASH_SS, &FLASH_SPI_PORT); // Use hardware SPI

// Alternatively you can define and use non-SPI pins!
Expand Down
6 changes: 3 additions & 3 deletions examples/fatfs_print_file/fatfs_print_file.ino
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
// sure to change the fatfs
// object type below to match.

#if !defined(SS1)

#if (SPI_INTERFACES_COUNT == 1)
#define FLASH_SS SS // Flash chip SS pin.
#define FLASH_SPI_PORT SPI // What SPI port is Flash on?
#define NEOPIN 8
#else
#define FLASH_SS SS1 // Flash chip SS pin.
#define FLASH_SPI_PORT SPI1 // What SPI port is Flash on?
#define NEOPIN 40
#endif


Adafruit_SPIFlash flash(FLASH_SS, &FLASH_SPI_PORT); // Use hardware SPI

// Alternatively you can define and use non-SPI pins!
Expand Down
5 changes: 1 addition & 4 deletions examples/flash_erase/flash_erase.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,12 @@
// If you change this be
// sure to change the fatfs
// object type below to match.

#if !defined(SS1)
#if (SPI_INTERFACES_COUNT == 1)
#define FLASH_SS SS // Flash chip SS pin.
#define FLASH_SPI_PORT SPI // What SPI port is Flash on?
#define NEOPIN 8
#else
#define FLASH_SS SS1 // Flash chip SS pin.
#define FLASH_SPI_PORT SPI1 // What SPI port is Flash on?
#define NEOPIN 40
#endif

Adafruit_SPIFlash flash(FLASH_SS, &FLASH_SPI_PORT); // Use hardware SPI
Expand Down
7 changes: 4 additions & 3 deletions examples/flash_erase_express/flash_erase_express.ino
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,17 @@
// sure to change the fatfs
// object type below to match.

#if !defined(SS1)
#if (SPI_INTERFACES_COUNT == 1)
#define FLASH_SS SS // Flash chip SS pin.
#define FLASH_SPI_PORT SPI // What SPI port is Flash on?
#define NEOPIN 8
#else
#define FLASH_SS SS1 // Flash chip SS pin.
#define FLASH_SPI_PORT SPI1 // What SPI port is Flash on?
#define NEOPIN 40
#endif

#define NEOPIN 40 // neopixel pin


Adafruit_SPIFlash flash(FLASH_SS, &FLASH_SPI_PORT); // Use hardware SPI
// Alternatively you can define and use non-SPI pins!
//Adafruit_SPIFlash flash(SCK1, MISO1, MOSI1, FLASH_SS);
Expand Down

0 comments on commit 4f15bde

Please sign in to comment.