RGB led pin remap

This commit is contained in:
Mark Qvist 2023-01-09 22:27:52 +01:00
parent 0d59b6b672
commit 18c0f65295
3 changed files with 44 additions and 3 deletions

View File

@ -201,13 +201,20 @@
#define HAS_CONSOLE true #define HAS_CONSOLE true
#define HAS_PMU true #define HAS_PMU true
#define HAS_NP true #define HAS_NP true
#define HAS_SD true
const int pin_cs = 18; const int pin_cs = 18;
const int pin_reset = 23; const int pin_reset = 23;
const int pin_dio = 26; const int pin_dio = 26;
const int pin_np = 15; const int pin_np = 12;
const int pin_dac = 25;
const int pin_adc = 34;
const int SD_MISO = 2;
const int SD_MOSI = 15;
const int SD_CLK = 14;
const int SD_CS = 13;
#if HAS_NP == false #if HAS_NP == false
#if defined(EXTERNAL_LEDS) #if defined(EXTERNAL_LEDS)
const int pin_led_rx = 15; const int pin_led_rx = 12;
const int pin_led_tx = 4; const int pin_led_tx = 4;
#else #else
const int pin_led_rx = 25; const int pin_led_rx = 25;

View File

@ -3,6 +3,14 @@
#include <WiFi.h> #include <WiFi.h>
#include <WebServer.h> #include <WebServer.h>
#include "SD.h"
#include "SPI.h"
#if HAS_SD
SPIClass *spi = NULL;
#endif
#if CONFIG_IDF_TARGET_ESP32 #if CONFIG_IDF_TARGET_ESP32
#include "esp32/rom/rtc.h" #include "esp32/rom/rtc.h"
#elif CONFIG_IDF_TARGET_ESP32S2 #elif CONFIG_IDF_TARGET_ESP32S2
@ -116,6 +124,32 @@ void console_start() {
console_dbg("SPIFFS Ready"); console_dbg("SPIFFS Ready");
} }
#if HAS_SD
spi = new SPIClass(HSPI);
spi->begin(SD_CLK, SD_MISO, SD_MOSI, SD_CS);
if(!SD.begin(SD_CS, *spi)){
console_dbg("No SD card inserted");
} else {
uint8_t cardType = SD.cardType();
if(cardType == CARD_NONE){
console_dbg("No SD card type");
} else {
console_dbg("SD Card Type: ");
if(cardType == CARD_MMC){
console_dbg("MMC");
} else if(cardType == CARD_SD){
console_dbg("SDSC");
} else if(cardType == CARD_SDHC){
console_dbg("SDHC");
} else {
console_dbg("UNKNOWN");
}
uint64_t cardSize = SD.cardSize() / (1024 * 1024);
Serial.printf("SD Card Size: %lluMB\n", cardSize);
}
}
#endif
console_register_pages(); console_register_pages();
server.begin(); server.begin();
led_indicate_console(); led_indicate_console();

View File

@ -989,7 +989,7 @@ void loop() {
if (console_active) { if (console_active) {
console_loop(); console_loop();
} else { } else {
led_indicate_standby(); //led_indicate_standby();
} }
} else { } else {