On Jan 22, 2009, at 6:28 AM, Dick Hollenbeck wrote:


We have this global called cur_state that all the drivers are
manipulating by direct assignment.    This makes it hard to trap or
watch these changes. I am proposing a pair of functions which would be
used instead:


set_current_state( tap_state_t )
tap_state_t get_current_state();


I am happy to do all the global edits to put these in. Then cur_state
would be made static i.e. private.  The value then is that we can add
debug logging to the set_current_state() and get a good feel for state
transitions when required.  We have a nice debug facility in
_DEBUG_JTAG_IO_ but nothing similar for state tracking.

What do folks think?   Would such a patch be accepted?


I've been thinking along the same lines. I really dislike using global variables like this. Are there any other globals that should have accessors instead?

Any better names wanted?

tap_set_current_state() and tap_get_current_state()? I can forsee other parts of the codebase having a current state that requires accessors.



Dick



_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

--
Rick Altherr
[email protected]

"He said he hadn't had a byte in three days. I had a short, so I split it with him."
 -- Unsigned



Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to