Add board variable to set where the EEPROM class will come from

This commit is contained in:
Josh Stewart 2019-03-05 01:02:02 +11:00
parent f96999dd2d
commit 942e4491c0
6 changed files with 8 additions and 9 deletions

View File

@ -11,6 +11,7 @@
*/ */
#define PORT_TYPE uint8_t //Size of the port variables (Eg inj1_pin_port). #define PORT_TYPE uint8_t //Size of the port variables (Eg inj1_pin_port).
#define PINMASK_TYPE uint8_t #define PINMASK_TYPE uint8_t
#define EEPROM_LIB_H <EEPROM.h>
void initBoard(); void initBoard();
uint16_t freeRam(); uint16_t freeRam();

View File

@ -11,6 +11,7 @@
#define micros_safe() micros() //timer5 method is not used on anything but AVR, the micros_safe() macro is simply an alias for the normal micros() #define micros_safe() micros() //timer5 method is not used on anything but AVR, the micros_safe() macro is simply an alias for the normal micros()
#ifndef USE_SERIAL3 #ifndef USE_SERIAL3
#define USE_SERIAL3 #define USE_SERIAL3
#define EEPROM_LIB_H <Fram.h>
#endif #endif
void initBoard(); void initBoard();
uint16_t freeRam(); uint16_t freeRam();

View File

@ -3,6 +3,7 @@
#if defined(CORE_STM32_OFFICIAL) #if defined(CORE_STM32_OFFICIAL)
#include <timer.h> #include <timer.h>
#include <stm32f4xx_ll_tim.h>
/* /*
*********************************************************************************************************** ***********************************************************************************************************
* General * General
@ -10,6 +11,8 @@
#define PORT_TYPE uint32_t #define PORT_TYPE uint32_t
#define PINMASK_TYPE uint32_t #define PINMASK_TYPE uint32_t
#define micros_safe() micros() //timer5 method is not used on anything but AVR, the micros_safe() macro is simply an alias for the normal micros() #define micros_safe() micros() //timer5 method is not used on anything but AVR, the micros_safe() macro is simply an alias for the normal micros()
#define EEPROM_LIB_H "src/BackupSram/BackupSramAsEEPROM.h"
#define digitalPinToInterrupt(p) (p)
#define USE_SERIAL3 #define USE_SERIAL3
void initBoard(); void initBoard();

View File

@ -13,6 +13,7 @@
#define BOARD_DIGITAL_GPIO_PINS 34 #define BOARD_DIGITAL_GPIO_PINS 34
#define BOARD_NR_GPIO_PINS 34 #define BOARD_NR_GPIO_PINS 34
#define USE_SERIAL3 #define USE_SERIAL3
#define EEPROM_LIB_H <EEPROM.h>
#define micros_safe() micros() //timer5 method is not used on anything but AVR, the micros_safe() macro is simply an alias for the normal micros() #define micros_safe() micros() //timer5 method is not used on anything but AVR, the micros_safe() macro is simply an alias for the normal micros()

View File

@ -10,6 +10,7 @@
#define PINMASK_TYPE uint32_t #define PINMASK_TYPE uint32_t
#define BOARD_NR_GPIO_PINS 52 //Not sure this is correct #define BOARD_NR_GPIO_PINS 52 //Not sure this is correct
#define BOARD_DIGITAL_GPIO_PINS 52 //Pretty sure this isn't right #define BOARD_DIGITAL_GPIO_PINS 52 //Pretty sure this isn't right
#define EEPROM_LIB_H <EEPROM.h> //The name of the file that provides the EEPROM class
#define micros_safe() micros() //timer5 method is not used on anything but AVR, the micros_safe() macro is simply an alias for the normal micros() #define micros_safe() micros() //timer5 method is not used on anything but AVR, the micros_safe() macro is simply an alias for the normal micros()
void initBoard(); void initBoard();
uint16_t freeRam(); uint16_t freeRam();

View File

@ -8,15 +8,7 @@ A full copy of the license may be found in the projects root directory
#include "globals.h" #include "globals.h"
#include "table.h" #include "table.h"
#include "comms.h" #include "comms.h"
#if defined(CORE_SAMD21) #include EEPROM_LIB_H //This is defined in the board .h files
#include "src/FlashStorage/FlashAsEEPROM.h"
#elif defined(ARDUINO_BLACK_F407VE)
#include "src/BackupSram/BackupSramAsEEPROM.h"
#elif defined(USE_FRAM)
#include <Fram.h>
#else
#include <EEPROM.h>
#endif
#include "storage.h" #include "storage.h"
void writeAllConfig() void writeAllConfig()