diff --git a/.gitignore b/.gitignore index 759b739..775e4b3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ my*.h compile_commands.json newcode.txt.old UserAddin.txt +platformio.ini diff --git a/IO_I2CDFPlayer.h b/IO_I2CDFPlayer.h index c291b56..466ce3e 100644 --- a/IO_I2CDFPlayer.h +++ b/IO_I2CDFPlayer.h @@ -511,6 +511,7 @@ public: if (pin == 0) { // Do nothing if not vPin 0 return _playing; } + return _playing; // fix for compile error: "control reaches end of non-void function [-Wreturn-type]" } void _display() override { @@ -549,8 +550,8 @@ private: setChecksum(out); // Prepend the DFPlayer command with REG address and UART Channel in _outbuffer - _outbuffer[0] = REG_THR << 3 | _UART_CH << 1; //TX FIFO and UART Channel - for ( int i = 1; i < sizeof(out)+1 ; i++){ + _outbuffer[0] = REG_THR << 3 | _UART_CH << 1; //TX FIFO and UART Channel + for ( uint8_t i = 1; i < sizeof(out)+1 ; i++){ _outbuffer[i] = out[i-1]; } @@ -616,6 +617,14 @@ private: uint16_t _divisor = (_sc16is752_xtal_freq/PRESCALER)/(BAUD_RATE * 16); // Calculate _divisor for baudrate TEMP_REG_VAL = 0x08; // UART Software reset UART_WriteRegister(REG_IOCONTROL, TEMP_REG_VAL); + + // Extra delay when using low frequency xtal after soft reset + // Test when using 1.8432 Mhz xtal + if(_sc16is752_xtal_freq == SC16IS752_XTAL_FREQ_LOW){ + _timeoutTime = micros() + 10000UL; // 10mS timeout + _awaitingResponse = true; + } + TEMP_REG_VAL = 0x00; // Set pins to GPIO mode UART_WriteRegister(REG_IOCONTROL, TEMP_REG_VAL); TEMP_REG_VAL = 0xFF; //Set all pins as output diff --git a/platformio.ini b/platformio.ini index 1ea33de..9797748 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,11 +11,11 @@ [platformio] default_envs = mega2560 - uno - nano - ESP32 - Nucleo-F411RE - Nucleo-F446RE +; uno +; nano +; ESP32 +; Nucleo-F411RE +; Nucleo-F446RE src_dir = . include_dir = . diff --git a/version.h b/version.h index 36c1338..8fd1185 100644 --- a/version.h +++ b/version.h @@ -6,6 +6,8 @@ #define VERSION "5.5.8" // 5.5.8 - EXSensorCam clean up to match other filters and // - avoid need for config.h settings +// - Test: IO_I2CDFPlayer.h inserted 10mS deleay in Init_SC16IS752() just after soft-reset for board with 1.8432 Mhz xtal +// - IO_I2CDFPlayer.h: fixed 2 compiler errors as the compilers are getting stricter // 5.5.7 - ESP32 bugfix packet buffer race (as 5.4.1) // 5.5.6 - Fix ESP32 build bug caused by include reference loop // 5.5.5 - Railcom implementation with IO_I2CRailcom driver