From e8bf697b1418b541f611a753af4f83726a0ea9d4 Mon Sep 17 00:00:00 2001 From: SV-Zanshin Date: Mon, 21 Nov 2016 07:27:46 +0000 Subject: [PATCH] Correct class instantiation --- Examples/sram_read_write_test/sram_read_write_test.ino | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Examples/sram_read_write_test/sram_read_write_test.ino b/Examples/sram_read_write_test/sram_read_write_test.ino index 13b4fd0..0358c1c 100644 --- a/Examples/sram_read_write_test/sram_read_write_test.ino +++ b/Examples/sram_read_write_test/sram_read_write_test.ino @@ -28,8 +28,7 @@ *******************************************************************************************************************/ #include // Include the library // #define SRAM_SS_PIN 2 // Pin 2 for SPI.Change if necessary// -uint32_t memorySize = 0; // Holds the computed memory size // -static MicrochipSRAM memory(SRAM_SS_PIN,memorySize); // Instantiate the memory class // +static MicrochipSRAM memory(SRAM_SS_PIN); // Instantiate the memory class // //----------------------------------// uint32_t address; char testArray[12] = "Hello World"; @@ -43,14 +42,14 @@ void setup() { // Serial.begin(9600); // Start serial comms at 9600 Baud // delay(3000); // Some Atmels need time to start // Serial.println("Starting Microchip SRAM test program"); // // - if (memorySize==0) { + if (memory.SRAMBytes==0) { Serial.print("- Error detecting SPI memory.\n"); Serial.print(" - Either an incorrect SPI pin was specified,\n- or the "); Serial.print("Microchip memory has been wired incorrectly,\n- or it is"); Serial.print("not a Microchip memory.\nSupported memories are:\n23x640"); Serial.print(", 23x256, 23x512, 23xx1024, 23LCV512 & 23LCV1024"); } else { - Serial.print("- A Microchip with ");Serial.print(memorySize); + Serial.print("- A Microchip with ");Serial.print(memory.SRAMBytes); Serial.print(" Bytes of memory has been detected.\n\n"); Serial.print("Writing 4 consecutive arrays starting at 100:\n"); address = 100;