On 27 October, 2014 - Dirk Hohndel wrote: > On Mon, Oct 27, 2014 at 10:04:57PM +0100, Anton Lundin wrote: > > On 27 October, 2014 - Anton Lundin wrote: > > > > > Here is the results of my last little project. This stack of patches > > > adds support for reading and writing the config blocks of the OSTC > > > devices. > > > All this bit magic was a bit tricky to get right so i wrote some > > > simulator code for tis to actually be able to test read/write. > > > > > > There are some blocks in this code that ain't pretty. I kinda ran out of > > > ideas to try to make it less ugly, so please, if anyone have some > > > suggestion of sane pattern we could use I'm all ears(eyes?). > > > > > > There is also some cases where we should care about errors from > > > libdivecomputer and show them propperly, but thats actually needed for > > > all the config parts, so i thought i send out these ones and attack that > > > later. > > > > > > > And yes, if anyone wonders, the code is tested against a real device. > > All and every corner isn't tested that thoroughly, but it looks like i > > actually got it right =) > > I'll need to get my OSTC 2N and my OSTC 3 out and do a > - backup > - write random settings > - restore > - backup > > cycle and check that the two backups are identical... > > I am obviously rather nervous about this code. A prior instantiation ended > up getting my OSTC3 into a state (with earlier firmware, thanks to > Matthias this couldn't happen anymore with the latest version) where it no > longer calculated any deco / ndl... which is kinda the point of a dive > computer. > > And of course, what's still missing is the firmware update :-) >
Yepp. The OSTC3 have a much "saner" interface for config than the OSTC's. Most of the debugging I've done have bin using the read/write file (OSTC_DEBUG) and comparing the memory dumps with a hex editor. That way I could change a setting and make sure the only bits flipped was the right ones. //Anton -- Anton Lundin +46702-161604 _______________________________________________ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface