Added UART1 HW serial for ESP32-S2

This commit is contained in:
Gunnar Skjold 2022-05-25 09:27:31 +02:00
parent ee12db4f51
commit ba7915ca7c
2 changed files with 10 additions and 2 deletions

View File

@ -608,6 +608,9 @@ void setupHanPort(uint8_t pin, uint32_t baud, uint8_t parityOrdinal, bool invert
hwSerial = &Serial2;
}
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
if(pin == 18) {
hwSerial = &Serial1;
}
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
#endif
#endif

View File

@ -1486,8 +1486,13 @@ String AmsWebServer::getSerialSelectOptions(int selected) {
gpioOptions += "<option value=\"3\">UART0 (GPIO3)</option>";
}
#if defined(CONFIG_IDF_TARGET_ESP32S2)
int numGpio = 31;
int gpios[] = {4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,25,32,33,34,35,36,39,40,41,42,43,44};
int numGpio = 30;
int gpios[] = {4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,21,22,23,25,32,33,34,35,36,39,40,41,42,43,44};
if(selected == 18) {
gpioOptions += "<option value=\"18\" selected>UART1 (GPIO18)</option>";
} else {
gpioOptions += "<option value=\"18\">UART1 (GPIO18)</option>";
}
#elif defined(ESP32)
int numGpio = 24;
int gpios[] = {4,5,6,7,8,10,11,12,13,14,15,17,18,19,21,22,23,25,32,33,34,35,36,39};