From 384a7a1d85a7e62a3d317863655f474e8566f77e Mon Sep 17 00:00:00 2001 From: kkloesener Date: Mon, 21 Dec 2020 23:23:24 +0100 Subject: [PATCH] fixing logical merge errors --- src/main.cpp | 21 +++++++++++---------- src/settings-espa1s.h | 23 ++++++----------------- src/settings.h | 4 ++-- 3 files changed, 19 insertions(+), 29 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e2353ef..2f7ff10 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3441,7 +3441,7 @@ void onWebsocketEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsE client->ping(); } else if (type == WS_EVT_DISCONNECT) { //client disconnected - Serial.printf("ws[%s][%u] disconnect: %u\n", server->url(), uint(client->id())); + Serial.printf("ws[%s][%u] disconnect: %u\n", server->url(), uint8_t(client->id())); } else if (type == WS_EVT_ERROR) { //error was received from the other end Serial.printf("ws[%s][%u] error(%u): %s\n", server->url(), client->id(), *((uint16_t*)arg), (char*)data); @@ -3743,8 +3743,8 @@ void setup() { Serial.printf("Built-In Amplifier enabled\n"); #endif - #if not defined SINGLE_SPI_ENABLE - #ifdef SD_MMC_1BIT_MODE + #ifndef SINGLE_SPI_ENABLE + #ifdef SD_MMC_1BIT_MODE pinMode(2, INPUT_PULLUP); #else // Init uSD-SPI @@ -3759,15 +3759,8 @@ void setup() { SPI.begin(); SPI.setFrequency(1000000); #endif - #ifdef RFID_READER_TYPE_MFRC522_I2C - i2cBusTwo.begin(ext_IIC_DATA, ext_IIC_CLK, 40000); - #endif #endif - mfrc522.PCD_Init(); - delay(50); - loggerNl((char *) FPSTR(rfidScannerReady), LOGLEVEL_DEBUG); - #ifndef SINGLE_SPI_ENABLE #ifdef SD_MMC_1BIT_MODE while (!SD_MMC.begin("/sdcard", true)) { @@ -3788,6 +3781,14 @@ void setup() { } + #ifdef RFID_READER_TYPE_MFRC522_I2C + i2cBusTwo.begin(ext_IIC_DATA, ext_IIC_CLK, 40000); + #endif + + mfrc522.PCD_Init(); + delay(50); + loggerNl((char *) FPSTR(rfidScannerReady), LOGLEVEL_DEBUG); + // welcome message Serial.println(F("")); Serial.println(F("_____ _____ _____ _____ _____ ")); diff --git a/src/settings-espa1s.h b/src/settings-espa1s.h index 3d23d38..ae257fd 100644 --- a/src/settings-espa1s.h +++ b/src/settings-espa1s.h @@ -1,25 +1,14 @@ #include "Arduino.h" //################## GPIO-configuration ############################## -#ifdef SD_MMC_1BIT_MODE - #define SPISD_CS 15 // GPIO for chip select (SD) - // uSD-card-reader (via SD-MMC 1Bit) - // - // SD_MMC uses fixed pins - // MOSI 15 - // SCKK 14 - // MISO 2 // hardware pullup may required -#else - // uSD-card-reader (via SPI) - #define SPISD_CS 15 // GPIO for chip select (SD) - #ifndef SINGLE_SPI_ENABLE - #define SPISD_MOSI 13 // GPIO for master out slave in (SD) => not necessary for single-SPI - #define SPISD_MISO 16 // GPIO for master in slave ou (SD) => not necessary for single-SPI - #define SPISD_SCK 14 // GPIO for clock-signal (SD) => not necessary for single-SPI - #endif +// uSD-card-reader (via SPI) +#define SPISD_CS 13 // GPIO for chip select (SD) +#ifndef SINGLE_SPI_ENABLE + #define SPISD_MOSI 15 // GPIO for master out slave in (SD) => not necessary for single-SPI + #define SPISD_MISO 2 // GPIO for master in slave ou (SD) => not necessary for single-SPI + #define SPISD_SCK 14 // GPIO for clock-signal (SD) => not necessary for single-SPI #endif - #define MFRC522_RST_PIN 12 // needed for i2c-comm MTDI on JTAG #define MFRC522_ADDR 0x28 // default Address of MFRC522 #define ext_IIC_CLK 23 // 14-pin-header diff --git a/src/settings.h b/src/settings.h index de1744c..6f7b214 100644 --- a/src/settings.h +++ b/src/settings.h @@ -15,8 +15,8 @@ //#define BLUETOOTH_ENABLE // Doesn't work currently (so don't enable) as there's not enough DRAM available //################## select SD card mode ############################# -#define SD_MMC_1BIT_MODE // run SD card in SD-MMC 1Bit mode -#define SINGLE_SPI_ENABLE // If only one SPI-instance should be used instead of two (not yet working!) (Works on ESP32-A1S with RFID via I2C) +//#define SD_MMC_1BIT_MODE // run SD card in SD-MMC 1Bit mode +//#define SINGLE_SPI_ENABLE // If only one SPI-instance should be used instead of two (not yet working!) (Works on ESP32-A1S with RFID via I2C) //################## select RFID reader ############################## //#define RFID_READER_TYPE_MFRC522_SPI // use MFRC522 via SPI