mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-12-24 13:21:23 +01:00
Starting on driver feedback
This commit is contained in:
parent
5e60fb4e27
commit
0cc07ed1df
@ -156,10 +156,15 @@ private:
|
|||||||
void _loop(unsigned long currentMicros) override {
|
void _loop(unsigned long currentMicros) override {
|
||||||
(void)currentMicros; // remove warning
|
(void)currentMicros; // remove warning
|
||||||
if (_deviceState == DEVSTATE_FAILED) return;
|
if (_deviceState == DEVSTATE_FAILED) return;
|
||||||
_command1Buffer[0] = EXIORDD;
|
if (_i2crb.isBusy()) return;
|
||||||
I2CManager.read(_i2cAddress, _digitalInputStates, _digitalPinBytes, _command1Buffer, 1, &_i2crb);
|
if (_commandFlag) {
|
||||||
_command1Buffer[0] = EXIORDAN;
|
_command1Buffer[0] = EXIORDD;
|
||||||
I2CManager.read(_i2cAddress, _analogueInputStates, _analoguePinBytes, _command1Buffer, 1, &_i2crb);
|
I2CManager.read(_i2cAddress, _digitalInputStates, _digitalPinBytes, _command1Buffer, 1, &_i2crb);
|
||||||
|
} else {
|
||||||
|
_command1Buffer[0] = EXIORDAN;
|
||||||
|
I2CManager.read(_i2cAddress, _analogueInputStates, _analoguePinBytes, _command1Buffer, 1, &_i2crb);
|
||||||
|
}
|
||||||
|
_commandFlag = !_commandFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Obtain the correct analogue input value
|
// Obtain the correct analogue input value
|
||||||
@ -243,6 +248,7 @@ private:
|
|||||||
byte _servoBuffer[7];
|
byte _servoBuffer[7];
|
||||||
uint8_t* _analoguePinMap;
|
uint8_t* _analoguePinMap;
|
||||||
I2CRB _i2crb;
|
I2CRB _i2crb;
|
||||||
|
bool _commandFlag = 0;
|
||||||
|
|
||||||
// EX-IOExpander protocol flags
|
// EX-IOExpander protocol flags
|
||||||
enum {
|
enum {
|
||||||
|
Loading…
Reference in New Issue
Block a user