Ugly Hack to get rid of the startstorage() function.

This commit is contained in:
hoogendijkta 2019-09-24 00:01:21 +02:00
parent caa1c676f3
commit 05a2414d9f
4 changed files with 6 additions and 8 deletions

View File

@ -20,7 +20,6 @@ void initialiseAll()
{
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
startstorage();
table3D_setSize(&fuelTable, 16);
table3D_setSize(&fuelTable2, 16);
table3D_setSize(&ignitionTable, 16);

View File

@ -41,7 +41,7 @@ SPIAsEEPROM::SPIAsEEPROM()
}
uint8_t SPIAsEEPROM::begin() {
uint8_t SpiFlashAvialable = 0;
SpiFlashAvialable = winbondSPIFlash.begin(_W25Q16,SPI,PB0);
uint8_t formatted = 0;
if(SpiFlashAvialable){
@ -174,6 +174,10 @@ uint8_t SPIAsEEPROM::read(uint16_t addressEEPROM){
//The first two pages will be used for the infoblock
//The first 4 bytes of each page must have the magic number
//version 0.1 does not check magic number
if(!SpiFlashAvialable){
begin();
}
uint8_t buf[INFOBYTES_PER_BYTE];

View File

@ -53,6 +53,7 @@
class SPIAsEEPROM {
private:
winbondFlashSPI winbondSPIFlash;
uint8_t SpiFlashAvialable = 0;
uint8_t ReadOutBuffer[BYTESPERSECTOR];
uint8_t magicbuf[4];
uint16_t sectorNumber;

View File

@ -11,12 +11,6 @@ A full copy of the license may be found in the projects root directory
#include EEPROM_LIB_H //This is defined in the board .h files
#include "storage.h"
void startstorage(){
#if defined(SPIFLASH_AS_EEPROM)
EEPROM.begin();
#endif
}
void writeAllConfig()
{
writeConfig(veSetPage);