On Apr 3, 2011 12:45 AM, "Peter Stuge" <[email protected]> wrote:
>
> Ali Lown wrote:
> > Aah. After failing once by committing too early, I then did it again!!
>
> Look up the interactive rebase feature of git. I use it a lot to
> rework commits which are intentionally or unintentionally incomplete.
Ok. I will do so.
> > The one attached below (usb_blaster.patch) implements those 2 rolled
> > into 1,
>
> I would split them up a little, because there are at least two
> distinct changes; 1. buffering and 2. LED action. It's a good idea to
> document these changes separately by having them be individual
> commits, each with a good commit message.
>
>
> > and then corrects a compile error too.
>
> Third patch it sounds like. Again with a clear commit message
> describing the problem and the solution.
Ok. I will break it up and resubmit later.
> Buffering can be a great performance improvement. But do you know if
> the hardware and software (openocd) can handle buffering? Ie. there
> may be some operations that must be committed immediately, besides
> read operations?
Not that I have found. By ensuring on the next read and when the program
closes that any leftover commands has let it work as expected.
Also, by forcing a buffer submit when the LED changes state (whch the jtag
main loop in OpenOCD does at the start and end of each set of jtag commands)
ensures all necessecary data is sent.
> Your implementation seems extremely dangerous to me. You add a global
> buffer, which will get corrupted if more than one device is being
> used. Is there a "contract" from openocd core that there will never
> be more than one instance of a hardware driver? If so this method
> would be safe, but is still pretty ugly. Is there an instance struct
> that could be used instead?
I simply extended what already existed, using 1 uint8_t as an output buffer.
Do people have more than 1 of the same adapter to be connected via the same
instance of openocd? Surely the fact they would have the same vid/pid
combination would ensure only the first adapter would ever be used?
I am not aware of any instance structs for this purpose in openocd.
> > +static void usb_blaster_addtowritebuffer(uint8_t value, bool
forcewrite)
> > +{
> > + out_buffer[out_count] = value;
> > + out_count += 1;
> > + if(out_count == BUF_LEN || forcewrite)
> > + usb_blaster_write_databuffer(out_buffer,
out_count);
> > }
>
> There's an extra tab above. Please pay close attention to coding style.
Sorry, will amend.
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development