Completely removed header files for the old config files
This commit is contained in:
parent
6be6c7256d
commit
0c152a7dc5
@ -10,8 +10,8 @@ const Pin I2C_sda,
|
||||
const Pin I2C_scl,
|
||||
const Pin SPI_mosi,
|
||||
const Pin SPI_miso,
|
||||
const Pin SPI_clk//,
|
||||
//const SPISettings spiSpeed
|
||||
const Pin SPI_clk,
|
||||
const SPISettings spiSpeed
|
||||
):
|
||||
_I2C_sda(I2C_sda == DEFAULT_PIN ? GPIO_4_SDA : I2C_sda),
|
||||
_I2C_scl(I2C_scl == DEFAULT_PIN ? GPIO_5_SCL : I2C_scl),
|
||||
@ -22,7 +22,7 @@ _SPI_SDCard_cs(_SPI_SDCard_cs == DEFAULT_PIN ? GPIO_2 : SPI_SDCard_cs),
|
||||
_I2C_screenAddress(I2C_screenAddress),
|
||||
_I2C_IOExpanderAddress(I2C_IOExpanderAddress),
|
||||
_I2C_RTCFlashAddress(_I2C_RTCFlashAddress),
|
||||
//_SPISpeed(spiSpeed),
|
||||
_SPISpeed(spiSpeed),
|
||||
_screenWidth(screenWidth),
|
||||
_screenHeight(screenHeight)
|
||||
{
|
||||
@ -75,10 +75,10 @@ uint16_t BoardConfig::getRTCFlashAddress() const
|
||||
}
|
||||
|
||||
|
||||
/*SPISettings BoardConfig::getSPISpeed() const
|
||||
SPISettings BoardConfig::getSPISpeed() const
|
||||
{
|
||||
return _SPISpeed;
|
||||
}*/
|
||||
}
|
||||
|
||||
uint16_t BoardConfig::getScreenWidth() const
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
#ifndef BOARDCONFIG_H
|
||||
#define BOARDCONFIG_H
|
||||
#include "definition.h"
|
||||
//#include <SdFat.h>
|
||||
#include <SdFat.h>
|
||||
|
||||
class BoardConfig
|
||||
{
|
||||
@ -21,8 +21,8 @@ class BoardConfig
|
||||
const Pin I2C_scl = GPIO_5_SCL,
|
||||
const Pin SPI_mosi = GPIO_13_MOSI,
|
||||
const Pin SPI_miso = GPIO_12_MISO,
|
||||
const Pin SPI_clk = GPIO_14_CLK//,
|
||||
//const SPISettings spiSpeed = SPI_FULL_SPEED
|
||||
const Pin SPI_clk = GPIO_14_CLK,
|
||||
const SPISettings spiSpeed = SPI_FULL_SPEED
|
||||
);
|
||||
|
||||
Pin getI2C_sda() const;
|
||||
@ -37,7 +37,7 @@ class BoardConfig
|
||||
uint16_t getI2C_IOExpanderAddress() const;
|
||||
uint16_t getRTCFlashAddress() const;
|
||||
|
||||
//SPISettings getSPISpeed() const;
|
||||
SPISettings getSPISpeed() const;
|
||||
|
||||
uint16_t getScreenWidth() const;
|
||||
uint16_t getScreenHeight() const;
|
||||
@ -58,7 +58,7 @@ class BoardConfig
|
||||
const uint16_t _I2C_RTCFlashAddress;
|
||||
|
||||
//3) SPI Speed
|
||||
//const SPISettings _SPISpeed;
|
||||
const SPISettings _SPISpeed;
|
||||
|
||||
//4) Miscellaneous
|
||||
const uint16_t _screenWidth;
|
||||
|
@ -22,7 +22,7 @@ _error(0)
|
||||
Wire.begin(_boardConfig.getI2C_sda(), _boardConfig.getI2C_scl());
|
||||
if(!_rtc.begin()) _error |= RTC_BEGIN_ERR;
|
||||
if(!_display.begin(SSD1306_SWITCHCAPVCC, _boardConfig.getI2C_screenAddress())){ _error |= DISP_BEGIN_ERR; }
|
||||
if(!_sdCardManager.begin(_boardConfig.getSPI_SDCard_cs(), 8000000)){ _error |= SDCARD_INIT_ERR; Serial.print("Failed to init SDCard : SPI_SPEED : "); Serial.print(8000000); Serial.print(" CS PIN : "); Serial.println(_boardConfig.getSPI_SDCard_cs());}
|
||||
if(!_sdCardManager.begin(_boardConfig.getSPI_SDCard_cs(), _boardConfig.getSPISpeed())){ _error |= SDCARD_INIT_ERR; Serial.print("Failed to init SDCard : SPI_SPEED : "); Serial.print(8000000); Serial.print(" CS PIN : "); Serial.println(_boardConfig.getSPI_SDCard_cs());}
|
||||
_connectivityManager = new ConnectivityManager(_sdCardManager);
|
||||
if(!_pcf.begin()){_error |= IO_INIT_ERR;}
|
||||
}
|
||||
@ -51,7 +51,7 @@ _error(0)
|
||||
Wire.begin(_boardConfig.getI2C_sda(), _boardConfig.getI2C_scl());
|
||||
if(!_rtc.begin()) _error |= RTC_BEGIN_ERR;
|
||||
if(!_display.begin(SSD1306_SWITCHCAPVCC, _boardConfig.getI2C_screenAddress())) _error |= DISP_BEGIN_ERR;
|
||||
if(!_sdCardManager.begin(_boardConfig.getSPI_SDCard_cs(), 8000000)){ _error |= SDCARD_INIT_ERR; Serial.print("Failed to init SDCard : SPI_SPEED : "); Serial.print(8000000); Serial.print(" CS PIN : "); Serial.println(_boardConfig.getSPI_SDCard_cs());}
|
||||
if(!_sdCardManager.begin(_boardConfig.getSPI_SDCard_cs(), _boardConfig.getSPISpeed())){ _error |= SDCARD_INIT_ERR; Serial.print("Failed to init SDCard : SPI_SPEED : "); Serial.print(8000000); Serial.print(" CS PIN : "); Serial.println(_boardConfig.getSPI_SDCard_cs());}
|
||||
_connectivityManager = new ConnectivityManager(_sdCardManager);
|
||||
if(!_pcf.begin()){_error |= IO_INIT_ERR;}
|
||||
}
|
||||
|
@ -29,11 +29,11 @@ void setup()
|
||||
Serial.print("AP PASSWORD : ");if((*cfgDictionary)("PASSWORD") != NULL)Serial.println((*cfgDictionary)("PASSWORD")->stringValue());
|
||||
}
|
||||
|
||||
CFGFileParser cfgFileParsert1(sab.getSdCardManager(), "/CONFIG/TEST1.CFG");
|
||||
/*CFGFileParser cfgFileParsert1(sab.getSdCardManager(), "/CONFIG/TEST1.CFG");
|
||||
CFGFileParser cfgFileParsert2(sab.getSdCardManager(), "/CONFIG/TEST2.CFG");
|
||||
|
||||
Serial.print("TEST1 : ");Serial.println(cfgFileParsert1.save(cfgDictionary));
|
||||
Serial.print("TEST2 : ");Serial.println(cfgFileParsert2.save(cfgDictionary));
|
||||
Serial.print("TEST2 : ");Serial.println(cfgFileParsert2.save(cfgDictionary));*/
|
||||
|
||||
delete cfgDictionary;
|
||||
|
||||
|
@ -121,7 +121,7 @@ boolean sdCardMountApi(WEBServer<WEBClient>::HttpRequestData &HRD, WiFiClient *w
|
||||
float *sdCardSize = (float *) &pV->pView->sdCardSize;
|
||||
char buffer[200];
|
||||
|
||||
if(p->getSdCardManager().begin(p->getBoardConfig().getSPI_SDCard_cs(), 8000000))
|
||||
if(p->getSdCardManager().begin(p->getBoardConfig().getSPI_SDCard_cs(), p->getBoardConfig().getSPISpeed()))
|
||||
{
|
||||
sprintf(buffer,"HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{ \"status\" : \"ok\", \"card\" : \"mounted\" }");
|
||||
*sdCardSize = p->getSdCardManager().getSize(GBYTE);
|
||||
|
Loading…
Reference in New Issue
Block a user