Skip to content

Resolve warning and compile errors with examples. #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

#include <EEPROM.h>

// Give a default if the variant does not define one.
#ifndef A0
#define A0 0
#endif

void setup()
{
Serial.begin(9600);
Expand All @@ -39,7 +44,7 @@ void setup()
Serial.println("8 bit tests");
byte myValue1 = 200;
byte myValue2 = 23;
randomLocation = random(0, FLASH_EEPROM_SIZE);
randomLocation = random(0, AP3_FLASH_EEPROM_SIZE);

startTime = millis();
EEPROM.write(randomLocation, myValue1); //(location, data)
Expand All @@ -61,7 +66,7 @@ void setup()
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
uint16_t myValue3 = 3411;
int16_t myValue4 = -366;
randomLocation = random(0, FLASH_EEPROM_SIZE);
randomLocation = random(0, AP3_FLASH_EEPROM_SIZE);

EEPROM.put(randomLocation, myValue3);
EEPROM.put(randomLocation + 2, myValue4);
Expand All @@ -82,7 +87,7 @@ void setup()
Serial.printf("Size of int: %d\n", sizeof(int));
int myValue5 = -245000;
unsigned int myValue6 = 400123;
randomLocation = random(0, FLASH_EEPROM_SIZE);
randomLocation = random(0, AP3_FLASH_EEPROM_SIZE);

EEPROM.put(randomLocation, myValue5);
EEPROM.put(randomLocation + 4, myValue6);
Expand All @@ -99,7 +104,7 @@ void setup()
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
int32_t myValue7 = -341002;
uint32_t myValue8 = 241544;
randomLocation = random(0, FLASH_EEPROM_SIZE);
randomLocation = random(0, AP3_FLASH_EEPROM_SIZE);

EEPROM.update(randomLocation, myValue7);
EEPROM.update(randomLocation + 4, myValue8);
Expand All @@ -117,7 +122,7 @@ void setup()
Serial.printf("Size of float: %d\n", sizeof(float));
float myValue9 = -7.35;
float myValue10 = 5.22;
randomLocation = random(0, FLASH_EEPROM_SIZE);
randomLocation = random(0, AP3_FLASH_EEPROM_SIZE);

EEPROM.update(randomLocation, myValue9);
EEPROM.update(randomLocation + 4, myValue10);
Expand All @@ -138,7 +143,7 @@ void setup()
Serial.printf("Size of double: %d\n", sizeof(double));
double myValue11 = -290.3485723409857;
double myValue12 = 384.95734987;
randomLocation = random(0, FLASH_EEPROM_SIZE);
randomLocation = random(0, AP3_FLASH_EEPROM_SIZE);

EEPROM.update(randomLocation, myValue11);
EEPROM.update(randomLocation + 8, myValue12);
Expand All @@ -157,7 +162,7 @@ void setup()
{
if (x % 32 == 0)
Serial.println();
Serial.printf("0x%08X ", *(uint32_t *)(FLASH_EEPROM_START + x));
Serial.printf("0x%08X ", *(uint32_t *)(AP3_FLASH_EEPROM_START + x));
}
Serial.println();
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/EEPROM/src/EEPROM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ void ap3_EEPROM::get(uint16_t eepromLocation, double &dataToGet)
double lf;
uint32_t b[2];
} temp;
temp.b[1] = *(uint32_t *)(AP3_FLASH_EEPROM_START + eepromLocation); //LSB;
temp.b[0] = *(uint32_t *)(AP3_FLASH_EEPROM_START + eepromLocation + 4) << 32; //MSB;
temp.b[1] = *(uint32_t *)(AP3_FLASH_EEPROM_START + eepromLocation); //LSB;
temp.b[0] = *(uint32_t *)(AP3_FLASH_EEPROM_START + eepromLocation + 4); //MSB;
dataToGet = temp.lf;
}

Expand Down
11 changes: 0 additions & 11 deletions libraries/SPI/src/SPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,6 @@
#include <Arduino.h>
#include "ap3_iomaster.h"

// Give a warning if the variant did not define these symbols:
#ifndef MOSI
#warning "variant has no definition for pin number 'MOSI'"
#endif // MOSI
#ifndef MISO
#warning "variant has no definition for pin number 'MISO'"
#endif // MISO
#ifndef SCK
#warning "variant has no definition for pin number 'SCK'"
#endif // SCK

// SPI_HAS_TRANSACTION means SPI has
// - beginTransaction()
// - endTransaction()
Expand Down