Fixed build errors

This commit is contained in:
Gunnar Skjold
2024-01-20 13:49:47 +01:00
parent f334847e82
commit afcc542e25
3 changed files with 4 additions and 4 deletions

View File

@@ -1199,7 +1199,7 @@ void AmsWebServer::translationsJson() {
} }
server.sendHeader(HEADER_CACHE_CONTROL, CACHE_1DA); server.sendHeader(HEADER_CACHE_CONTROL, CACHE_1DA);
File file = LittleFS.open(buf); File file = LittleFS.open(buf, "r");
server.setContentLength(file.size()); server.setContentLength(file.size());
server.send(200, MIME_JSON); server.send(200, MIME_JSON);
@@ -2050,7 +2050,7 @@ HTTPUpload& AmsWebServer::uploadFile(const char* path) {
if(LittleFS.exists(path)) { if(LittleFS.exists(path)) {
LittleFS.remove(path); LittleFS.remove(path);
} }
file = LittleFS.open(path, FILE_WRITE); file = LittleFS.open(path, "w");
if(debugger->isActive(RemoteDebug::DEBUG)) { if(debugger->isActive(RemoteDebug::DEBUG)) {
debugger->printf_P(PSTR("handleFileUpload Open file and write: %u\n"), upload.currentSize); debugger->printf_P(PSTR("handleFileUpload Open file and write: %u\n"), upload.currentSize);
} }

View File

@@ -845,7 +845,7 @@ void handleUiLanguage() {
if(status == HTTP_CODE_OK) { if(status == HTTP_CODE_OK) {
snprintf_P((char*) commonBuffer, BUF_SIZE_COMMON, PSTR("/translations-%s.json"), ui.language); snprintf_P((char*) commonBuffer, BUF_SIZE_COMMON, PSTR("/translations-%s.json"), ui.language);
File file = LittleFS.open((char*) commonBuffer, FILE_WRITE); File file = LittleFS.open((char*) commonBuffer, "w");
size_t written = http.writeToStream(&file); size_t written = http.writeToStream(&file);
file.close(); file.close();
if(written > 0) { if(written > 0) {

View File

@@ -46,7 +46,7 @@ void PulseMeterCommunicator::getCurrentConfig(MeterConfig& meterConfig) {
void PulseMeterCommunicator::setupGpio() { void PulseMeterCommunicator::setupGpio() {
if(debugger->isActive(RemoteDebug::DEBUG)) debugger->printf_P(PSTR("Setting up Pulse Meter GPIO, rx: %d, tx: %d\n"), meterConfig.rxPin, meterConfig.txPin); if(debugger->isActive(RemoteDebug::DEBUG)) debugger->printf_P(PSTR("Setting up Pulse Meter GPIO, rx: %d, tx: %d\n"), meterConfig.rxPin, meterConfig.txPin);
if(meterConfig.rxPin != NOT_A_PIN) { if(meterConfig.rxPin != NOT_A_PIN) {
pinMode(meterConfig.rxPin, meterConfig.rxPinPullup ? INPUT_PULLUP : INPUT_PULLDOWN); pinMode(meterConfig.rxPin, meterConfig.rxPinPullup ? INPUT_PULLUP : INPUT);
} }
if(meterConfig.txPin != NOT_A_PIN) { if(meterConfig.txPin != NOT_A_PIN) {
pinMode(meterConfig.txPin, OUTPUT); pinMode(meterConfig.txPin, OUTPUT);