DCC-EX / BaseStation-EX

Partial re-write of DCC++, maintained for historical purposes. Not actively bug-fixed or developed
https://dcc-ex.com
19 stars 8 forks source link

Update PacketRegister.cpp (#2) #8

Closed FrightRisk closed 4 years ago

FrightRisk commented 4 years ago

The culprit is the packet sequence that is used to trigger programming, e.g. in RegisterList::readCV in PacketRegister.cpp

loadPacket(0,resetPacket,2,3); // NMRA recommends starting with 3 reset packets loadPacket(0,bRead,3,5); // NMRA recommends 5 verfy packets loadPacket(0,resetPacket,2,1); // forces code to wait until all repeats of bRead are completed (and decoder begins to respond)

This is the original code from the BaseStation. The DH10C does not perform the acknowledgement because of the last resetPacket that is used to wait until all bRead Packets have been digested. I changed the resetPacket to another bRead Packet and all works fine.

loadPacket(0,resetPacket,2,3); // NMRA recommends starting with 3 reset packets loadPacket(0,bRead,3,5); // NMRA recommends 5 verify packets loadPacket(0,bRead,3,1); // forces code to wait until all repeats of bRead are completed (and decoder begins to respond)

Similar changes are made in the routines for WriteCVByte and WriteCVBit.

Fix typos bWrite was spelled bWtite

Co-authored-by: FrightRisk 37218136+FrightRisk@users.noreply.github.com