diff --git a/src/app/BoardConfig.h b/src/app/BoardConfig.h index 1f5b13d..73e0741 100644 --- a/src/app/BoardConfig.h +++ b/src/app/BoardConfig.h @@ -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; diff --git a/src/app/HttpClient.cpp b/src/app/HttpClient.cpp index 0f074d3..a62c177 100644 --- a/src/app/HttpClient.cpp +++ b/src/app/HttpClient.cpp @@ -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)); } diff --git a/src/app/ScreenManager.cpp b/src/app/ScreenManager.cpp index de5e43d..0ed0f9a 100644 --- a/src/app/ScreenManager.cpp +++ b/src/app/ScreenManager.cpp @@ -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; diff --git a/src/app/TCPClient.cpp b/src/app/TCPClient.cpp index c893a19..32811d6 100644 --- a/src/app/TCPClient.cpp +++ b/src/app/TCPClient.cpp @@ -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), diff --git a/src/app/TCPClient.h b/src/app/TCPClient.h index ee9c143..b22ba48 100644 --- a/src/app/TCPClient.h +++ b/src/app/TCPClient.h @@ -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);