On Monday 21 September 2009, Johnny Halfmoon wrote:
> Okay. Like this then:
Merged with some cleanups, including the one noted by Rolf.
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/o
On Monday 21 September 2009, Johnny Halfmoon wrote:
>
> David Brownell wrote:
> > On Sunday 20 September 2009, Johnny Halfmoon wrote:
> >> + if ((retval = flash_check_sector_parameters(cmd_ctx,
> >> first, last, p->num_sectors)) !
> >
> > I had in mind more like
> >
> > uint32
Hi Johnny,
it should be
> +if ( first > last ) {
not
> +if ( first >= last ) {
With first=last you can erase a single sector.
Regards,
Rolf
--- Johnny Halfmoon schrieb am Mo, 21.9.2009:
> Von: Johnny Halfmoon
> Betreff: Re: [Openocd-development] [PATCH] Enhanc
David Brownell wrote:
> On Sunday 20 September 2009, Johnny Halfmoon wrote:
>> + if ((retval = flash_check_sector_parameters(cmd_ctx, first,
>> last, p->num_sectors)) !
>
> I had in mind more like
>
> uint32_t value;
Okay. Like this then:
= = = = = = = = = = = =
doc/
On Sunday 20 September 2009, Johnny Halfmoon wrote:
> + if ((retval = flash_check_sector_parameters(cmd_ctx, first,
> last, p->num_sectors)) !
I had in mind more like
uint32_t value;
retval = parse_u32(argv[X], &value);
if (retval != ERROR_OK)
Fair enough. Try this then (with some added parameter checking)...
= = =
doc/openocd.texi |6 --
src/flash/flash.c | 47 ---
2 files changed, 48 insertions(+), 5 deletions(-)
Index: src/flash/flash.c
===
On Sun, Sep 20, 2009 at 10:23 PM, Michael Schwingen
wrote:
> David Brownell wrote:
>> Good point; Øyvind's suggestion (keyword "last") seems
>> to be the best overall solution then.
>>
>
> That would be my favourite, unless it needs ridiculous amounts of code
> to implement.
Agree 100%. What abou
David Brownell wrote:
> Good point; Øyvind's suggestion (keyword "last") seems
> to be the best overall solution then.
>
That would be my favourite, unless it needs ridiculous amounts of code
to implement.
cu
Michael
___
Openocd-development mailing
Could you use a keyword like "last", rather than try to
overload the meaning of integers?
Using -1 is quicker, easier and more seductive
--
Øyvind Harboe
Embedded software and hardware consulting services
http://www.zylin.com
___
Openocd-developme
David Brownell wrote:
>>
>> +if (last < 0)
>> +last = p->num_sectors - 1;
>> +
>>
>
> This relies on the lack of error checking for testing "first"
> and "last" ... better to add error checking, and then use zero
> as the magic number.
>
Hm - would'nt that
On Sunday 20 September 2009, Johnny Halfmoon wrote:
> This patch slightly enhances the behaviour of the standard erase and protect
> functions. After applying this patch, defining -1 as the last sector tells
> OpenOCD to protect or erase the entire flash bank. The relevant part in the
> OpenOCD
This patch slightly enhances the behaviour of the standard erase and protect
functions. After applying this patch, defining -1 as the last sector tells
OpenOCD to protect or erase the entire flash bank. The relevant part in the
OpenOCD has been updated.
Signed-off-by: Johnny Halfmoon
---
d
12 matches
Mail list logo