Commit Graph

9 Commits

Author SHA1 Message Date
Stefan Rueger 02fe08aed2
Open programmer before allocating part
So any programmer that knows exactly which part it is connected to
can set the -p part option should the user not have done so.

Also no longer exits main without closing open programmer.
2022-11-01 18:12:00 +00:00
Stefan Rueger dab99c0823
Update NEWS 2022-08-31 17:35:03 +01:00
Stefan Rueger c2c9053b13
Show comments with -p*/s or -c*/s and reduce -p */r raw output 2022-08-12 00:28:54 +01:00
Stefan Rueger 08049a40ea
Implement dev option -c */[ASsrt] skeleton
Also changed usbdev, usbsn, usbvendor and usbproduct components from
PROGRAMMER structure to be cached string pointers rather than fixed-size
arrays. These will be initialised by pgm_new() with a pointer to nul;
2022-08-07 14:06:04 +01:00
Stefan Rueger 62dcc2e6e8 Declare useful CMDBIT/part functions of developer_opts.c in libavrdude.h 2022-07-26 23:55:42 +01:00
Stefan Rueger 572849ec2a Provide avr_set_addr_mem() to set addresses in SPI opcodes within boundaries
The function avr_set_addr_mem(AVRMEM *mem, int opnum, unsigned char *cmd,
unsigned long addr) is meant to replace avr_set_addr(OPCODE *op, unsigned
char *cmd, unsigned long addr) in future.

avr_set_addr_mem() has more information about the context of the task in that
it knows the memory size, memory page size, whether or not the memory is a
flash memory (which gets words addressees supplied) and, crucially, knows
which SPI operation it is meant to compute the address bits for.

avr_set_addr_mem() first computes the interval of bit numbers that must be
supplied for the SPI command to stand a chance to work. The function only
sets those address bits that are needed. Once all avr_set_addr() function
calls have been replaced by avr_set_addr_mem(), the SPI commands that need an
address can afford to declare in avrdude.conf all 16 address bits in the
middle two bytes of the SPI command. This over-declaration will be corrected
during runtime by avr_set_addr_mem(). One consequence of this is that parts
can inherit smaller or larger memories from parents without the need to use
different SPI codes in avrdude.conf. Another consequence is that
avr_set_addr_mem() can, and does, tell the caller whether vital address bits
were not declared in the SPI opcode. During parsing of avrdude.conf this
might be utilised to generate a corresponding warning. This will uncover
problematic SPI codes in avrdude.conf that in the past went undetected.
2022-07-21 21:42:07 +01:00
Stefan Rueger 55f6765ea5 Make more useful functions from developer_optc.c available 2022-07-21 18:47:48 +01:00
Stefan Rueger 192e118d2c Make useful functions from developer_optc.c available 2022-07-21 18:36:04 +01:00
Stefan Rueger 3bd75e74c6 Move developer options into own source file and expand part description -p \*
-p \*/c  check address bits in SPI commands
  -p \*/d  description of core part features
  -p \*/o  opcodes for SPI programming parts and memories
  -p \*/s  show avrdude.conf entries of parts
  -p \*/ss show full avrdude.conf entry as tab separated table
  -p \*/w  wd_... constants for ISP parts
  -p \*/\* all of the above except -p \*/s
  -p \*    same as -p\*/\*
2022-06-28 20:34:31 +01:00