Signal decoder save state to EEPROM
adrianleh opened this issue · 4 comments
Hi,
I'm building my own signal (as in railway signal) decoder using your library. For this to work correctly, I need to persist the signal state to EEPROM, so that signals still show the same value after a reboot.
Hence, I have two questions:
- How do I best store the state? Do I use the CV library or are there EEPROM addresses I can mess with myself such that the library is not impacted?
- Does DCC specify (and your library support) a shutdown command? (This would be useful to have fewer write cycles and only persist at shutdown time, instead of multiple times throughout the operation)
Thanks!
Hi Alex,
thanks for the super detailed response. Thanks for the idea of the custom CV definition, that sounds like a clean way to solve the issue. I have also already wrote scripts that wait until there has been no writes for 10sec and then writes.
As for your latter point to the Reset and my DCC system: I currently test with a DCCex system but am planning on integrating this with a Maerklin Central Station 2 once I know it works. So I think generating resets will be quite tough, unfortunately. But if you have any ideas or other insight on Maerklin DCC systems, that'd be super helpful.
Thanks!
The custom CV idea sounds interesting. I'll see what I can implement with that and if something useful should fall out of it, I'll make a PR.
I think that answers the questions of the issue and I'll go ahead and close it. Thank you for your help, Alex!
- Adrian