1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-25 09:06:13 +01:00

Compare commits

..

No commits in common. "efe96d1d842c40774bbd5622568109fc60bcc0d1" and "1bdb05a471e7f140b22fd51ae72834fe2e9d0ebc" have entirely different histories.

3 changed files with 4 additions and 11 deletions

View File

@ -50,12 +50,12 @@ EXTurntable::EXTurntable(VPIN firstVpin, int nPins, I2CAddress I2CAddress) {
// Initialisation of EXTurntable // Initialisation of EXTurntable
void EXTurntable::_begin() { void EXTurntable::_begin() {
I2CManager.begin(); I2CManager.begin();
I2CManager.setClock(1000000);
if (I2CManager.exists(_I2CAddress)) { if (I2CManager.exists(_I2CAddress)) {
#ifdef DIAG_IO #ifdef DIAG_IO
_display(); _display();
#endif #endif
} else { } else {
DIAG(F("EX-Turntable I2C:%s device not found"), _I2CAddress.toString());
_deviceState = DEVSTATE_FAILED; _deviceState = DEVSTATE_FAILED;
} }
} }

View File

@ -134,13 +134,12 @@ private:
} }
} }
// Return the position sent by the rotary encoder software // Device specific read function
int _readAnalogue(VPIN vpin) override { int _readAnalogue(VPIN vpin) override {
if (_deviceState == DEVSTATE_FAILED) return 0; if (_deviceState == DEVSTATE_FAILED) return 0;
return _position; return _position;
} }
// Send the feedback value to the rotary encoder software
void _write(VPIN vpin, int value) override { void _write(VPIN vpin, int value) override {
if (vpin == _firstVpin + 1) { if (vpin == _firstVpin + 1) {
if (value != 0) value = 0x01; if (value != 0) value = 0x01;
@ -149,12 +148,9 @@ private:
} }
} }
// Send a position update to the rotary encoder software
// To be valid, must be 0 to 255, and different to the current position
// If the current position is the same, it was initiated by the rotary encoder
void _writeAnalogue(VPIN vpin, int position, uint8_t profile, uint16_t duration) override { void _writeAnalogue(VPIN vpin, int position, uint8_t profile, uint16_t duration) override {
if (vpin == _firstVpin + 2) { if (vpin == _firstVpin + 2) {
if (position >= 0 && position <= 255 && position != _position) { if (position >= 0 && position <= 255) {
byte newPosition = position & 0xFF; byte newPosition = position & 0xFF;
byte _positionBuffer[2] = {RE_MOVE, newPosition}; byte _positionBuffer[2] = {RE_MOVE, newPosition};
I2CManager.write(_I2CAddress, _positionBuffer, 2); I2CManager.write(_I2CAddress, _positionBuffer, 2);

View File

@ -4,10 +4,7 @@
#include "StringFormatter.h" #include "StringFormatter.h"
#define VERSION "4.2.62" #define VERSION "4.2.61"
// 4.2.62 - Update IO_RotaryEncoder.h to ignore sending current position
// - Update IO_EXTurntable.h to remove forced I2C clock speed
// - Show device offline if EX-Turntable not connected
// 4.2.61 - MAX_CURRENT restriction (caps motor shield value) // 4.2.61 - MAX_CURRENT restriction (caps motor shield value)
// 4.2.60 - Add mDNS capability to ESP32 for autodiscovery // 4.2.60 - Add mDNS capability to ESP32 for autodiscovery
// 4.2.59 - Fix: AP SSID was DCC_ instead of DCCEX_ // 4.2.59 - Fix: AP SSID was DCC_ instead of DCCEX_