mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-01-30 14:13:07 +01:00
IO_I2CDFPlayer.h update and test
- 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
This commit is contained in:
parent
95d90aa337
commit
58b180603a
1
.gitignore
vendored
1
.gitignore
vendored
@ -15,3 +15,4 @@ my*.h
|
|||||||
compile_commands.json
|
compile_commands.json
|
||||||
newcode.txt.old
|
newcode.txt.old
|
||||||
UserAddin.txt
|
UserAddin.txt
|
||||||
|
platformio.ini
|
||||||
|
@ -511,6 +511,7 @@ public:
|
|||||||
if (pin == 0) { // Do nothing if not vPin 0
|
if (pin == 0) { // Do nothing if not vPin 0
|
||||||
return _playing;
|
return _playing;
|
||||||
}
|
}
|
||||||
|
return _playing; // fix for compile error: "control reaches end of non-void function [-Wreturn-type]"
|
||||||
}
|
}
|
||||||
|
|
||||||
void _display() override {
|
void _display() override {
|
||||||
@ -550,7 +551,7 @@ private:
|
|||||||
|
|
||||||
// Prepend the DFPlayer command with REG address and UART Channel in _outbuffer
|
// 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
|
_outbuffer[0] = REG_THR << 3 | _UART_CH << 1; //TX FIFO and UART Channel
|
||||||
for ( int i = 1; i < sizeof(out)+1 ; i++){
|
for ( uint8_t i = 1; i < sizeof(out)+1 ; i++){
|
||||||
_outbuffer[i] = out[i-1];
|
_outbuffer[i] = out[i-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -616,6 +617,14 @@ private:
|
|||||||
uint16_t _divisor = (_sc16is752_xtal_freq/PRESCALER)/(BAUD_RATE * 16); // Calculate _divisor for baudrate
|
uint16_t _divisor = (_sc16is752_xtal_freq/PRESCALER)/(BAUD_RATE * 16); // Calculate _divisor for baudrate
|
||||||
TEMP_REG_VAL = 0x08; // UART Software reset
|
TEMP_REG_VAL = 0x08; // UART Software reset
|
||||||
UART_WriteRegister(REG_IOCONTROL, TEMP_REG_VAL);
|
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
|
TEMP_REG_VAL = 0x00; // Set pins to GPIO mode
|
||||||
UART_WriteRegister(REG_IOCONTROL, TEMP_REG_VAL);
|
UART_WriteRegister(REG_IOCONTROL, TEMP_REG_VAL);
|
||||||
TEMP_REG_VAL = 0xFF; //Set all pins as output
|
TEMP_REG_VAL = 0xFF; //Set all pins as output
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
[platformio]
|
[platformio]
|
||||||
default_envs =
|
default_envs =
|
||||||
mega2560
|
mega2560
|
||||||
uno
|
; uno
|
||||||
nano
|
; nano
|
||||||
ESP32
|
; ESP32
|
||||||
Nucleo-F411RE
|
; Nucleo-F411RE
|
||||||
Nucleo-F446RE
|
; Nucleo-F446RE
|
||||||
src_dir = .
|
src_dir = .
|
||||||
include_dir = .
|
include_dir = .
|
||||||
|
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
#define VERSION "5.5.8"
|
#define VERSION "5.5.8"
|
||||||
// 5.5.8 - EXSensorCam clean up to match other filters and
|
// 5.5.8 - EXSensorCam clean up to match other filters and
|
||||||
// - avoid need for config.h settings
|
// - 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.7 - ESP32 bugfix packet buffer race (as 5.4.1)
|
||||||
// 5.5.6 - Fix ESP32 build bug caused by include reference loop
|
// 5.5.6 - Fix ESP32 build bug caused by include reference loop
|
||||||
// 5.5.5 - Railcom implementation with IO_I2CRailcom driver
|
// 5.5.5 - Railcom implementation with IO_I2CRailcom driver
|
||||||
|
Loading…
Reference in New Issue
Block a user