[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avrdude-dev] [RFC] avrpart.c
From: |
Jan-Hinnerk Reichert |
Subject: |
Re: [avrdude-dev] [RFC] avrpart.c |
Date: |
Mon, 24 Nov 2003 02:53:31 +0100 |
User-agent: |
KMail/1.5.1 |
On Monday 24 November 2003 00:27, Brian Dean wrote:
> One way to simplify a bit would be to create a higher level
> function to do the erase, passing in the programmer as well as the
> 'do_cycles' option flag. That routine would save the cycle count,
> call the programmer's erase function, then restore the cycle count.
> Thus, the saving and restoring could be removed from each
> programmer's implementation and avoid code duplication there.
> Also, the high level erase function would be the one called from
> 'main.c' and 'term.c' instead of the programmer's erase function.
>
> Doing it that way instead of handing the cycle count at the places
> where an erase happens would keep 'main.c' and 'term.c' from both
> having to deal with the cycle count, and thus perhaps getting out
> of sync in the way that is implemented. Probably 'avr.c' or
> 'avrpart.c' would be a good place for this new high level erase
> function that knows how to save and restore the cycle count.
Inserting a highlevel erase into "avr.c" seems a good idea. We already
have avr_read() and avr_write(), so IMHO a avr_erase() would fit
nicely.
However, I think the (first stage of) avrpart.c-patch should go in
first. It makes a lot of room in avr.c (1219 lines -> 784 lines).
Right now the patch moves following functions to avrpart.c (files
marked with "*" are made available through "avrpart.h"
OPCODE related:
* avr_new_opcode()
* avr_set_addr()
* avr_set_input()
* avr_get_output()
* avr_set_bits()
- bittype()
- avr_op_str()
AVRMEM related:
* avr_new_memtype()
* avr_locate_mem()
* avr_initmem()
* avr_dup_mem()
* avr_mem_display()
AVRPART related:
* list_parts()
* locate_part()
* avr_new_part()
* avr_dup_part()
- reset_disp_str()
- pin_name()
* avr_display()
Hope I got them all; just found avr_display() some hours ago.
I will wait some days for further comments and discussion on this
patch. If everyone agrees, I would like to do the patch next Sunday
or Monday (I won't do it earlier, since I'm away for the weekend ;)
/Jan-Hinnerk