Swap DMX port to 1, persist user choice of port, validate port vs UART count

This commit is contained in:
Will Tatam
2024-03-07 10:44:07 +00:00
committed by Will Tatam
parent a56014bb66
commit fc4e7a2dee
3 changed files with 5 additions and 2 deletions

View File

@@ -105,6 +105,7 @@ bool DMXInput::installDriver()
{
const auto config = createConfig();
USER_PRINTF("DMX port: %u\n", inputPortNum);
if (!dmx_driver_install(inputPortNum, &config, DMX_INTR_FLAGS_DEFAULT)) {
USER_PRINTF("Error: Failed to install dmx driver\n");
return false;
@@ -133,7 +134,7 @@ void DMXInput::init(uint8_t rxPin, uint8_t txPin, uint8_t enPin, uint8_t inputPo
// }
#endif
if (inputPortNum < 3 && inputPortNum > 0) {
if (inputPortNum <= (SOC_UART_NUM - 1) && inputPortNum > 0) {
this->inputPortNum = inputPortNum;
}
else {