Removed a bunch of warnings + re added SPI_FULL_SPEED default value in the BoardConfig.h

This commit is contained in:
Th3maz1ng 2022-03-30 11:04:12 +02:00
parent ef8d944dd3
commit e732cf48aa
5 changed files with 17 additions and 21 deletions

View File

@ -22,7 +22,7 @@ class BoardConfig
const Pin SPI_mosi = GPIO_13_MOSI,
const Pin SPI_miso = GPIO_12_MISO,
const Pin SPI_clk = GPIO_14_CLK,
const uint32_t spiSpeed = 0//SPI_FULL_SPEED
const uint32_t spiSpeed = SPI_FULL_SPEED
);
Pin getI2C_sda() const;

View File

@ -192,7 +192,7 @@ HttpClient::HTTP_CODE HttpClient::isReplyAvailable(uint16_t timeout)
if(_httpCode == HTTP_CODE::UNDEFINED_CODE)
{
uint16_t safeSize = bytesCount > 99 ? 99 : bytesCount;
uint8_t bytesRed = buffer[peekBytes((uint8_t*)buffer,safeSize)] = '\0';
buffer[peekBytes((uint8_t*)buffer,safeSize)] = '\0';
//We look for the end of the first line ie : HTTP/1.1 200 OK\r\n
char *pNewLine = strstr(buffer, "\r\n");
//If we found the new line, we can retrieve the code
@ -367,7 +367,7 @@ void HttpClient::sendHeader(HttpMIMEType contentType, uint64_t contentLength, Di
if(contentLength > 0)
{
printf("Content-Length: %u\r\n", contentLength);
printf("Content-Length: %llu\r\n", contentLength);
printf("Content-Type: %s\r\n", httpMIMETypeToString(contentType, mime));
}

View File

@ -237,13 +237,15 @@ void ScreenManager::run()
}
else
_error = OK;
break;
case VIEW_NOT_FOUND:
break;
case VIEW_NOT_FOUND:
(*_viewNotFound.viewLogicFunction)(_displayRef, _viewNotFound.pData);
break;
case VIEW_FUNC_UNDEFINED:
case VIEW_FUNC_UNDEFINED:
(*_viewFuncUndefined.viewLogicFunction)(_displayRef, _viewFuncUndefined.pData);
break;
default:
break;
}
_displayRef.display();
@ -408,7 +410,7 @@ void ScreenManager::clearViews()
{
ViewLink *toDelete = cursor;
cursor = cursor->next;
free(cursor);
free(toDelete);
}
//Do not forget to mark the list as empty
_viewLinkedList = NULL;

View File

@ -2,13 +2,8 @@
//#define DEBUG_CL
TCPClient::TCPClient(WiFiClient client, uint8_t id, uint16_t dataBufferSize) : _client(client),
_clientState(NEW),
_error(OK),
_data(NULL),
_dataSize(0),
TCPClient::TCPClient(WiFiClient client, uint8_t id, uint16_t dataBufferSize) : _client(client),
_dataBufferSize(dataBufferSize+1),
_newDataAvailable(false),
_id(id)
{
#ifdef DEBUG_CL
@ -22,10 +17,9 @@ _id(id)
_error = MALLOC_ERR;
}
TCPClient::TCPClient(const TCPClient &Object) : _client(Object._client),
_clientState(Object._clientState),
TCPClient::TCPClient(const TCPClient &Object) : _clientState(Object._clientState),
_error(Object._error),
_data(NULL),
_client(Object._client),
_dataSize(Object._dataSize),
_dataBufferSize(Object._dataBufferSize),
_newDataAvailable(Object._newDataAvailable),

View File

@ -17,14 +17,14 @@ class TCPClient
bool operator==(TCPClient& Object);
void closeConnection();
protected:
enum ClientState {NEW, HANDLED, DISCARDED} _clientState;
enum Error {OK = 0, MALLOC_ERR = 1} _error;
enum ClientState {NEW, HANDLED, DISCARDED} _clientState = NEW;
enum Error {OK = 0, MALLOC_ERR = 1} _error = OK;
WiFiClient _client;
uint8_t *_data; //The actual data
uint16_t _dataSize; //The logical size of the data contained
uint8_t *_data = NULL; //The actual data
uint16_t _dataSize = 0; //The logical size of the data contained
uint16_t _dataBufferSize; //The physical size of the buffer
boolean _newDataAvailable;
boolean _newDataAvailable = false;
uint8_t _id;
void freeDataBuffer(uint16_t size);