2001-10-15 02:46:59 +00:00
|
|
|
/*
|
2003-02-08 04:17:25 +00:00
|
|
|
* avrdude - A Downloader/Uploader for AVR device programmers
|
2004-12-22 01:52:45 +00:00
|
|
|
* Copyright (C) 2000-2004 Brian S. Dean <bsd@bsdhome.com>
|
2006-07-16 21:30:14 +00:00
|
|
|
* Copyright (C) 2006 Joerg Wunsch <j@uriah.heep.sax.de>
|
2001-10-15 02:46:59 +00:00
|
|
|
*
|
2003-02-06 20:02:33 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2001-10-15 02:46:59 +00:00
|
|
|
*
|
2003-02-06 20:02:33 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2001-10-15 02:46:59 +00:00
|
|
|
*
|
2003-02-06 20:02:33 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
2012-11-20 14:03:50 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2001-10-15 02:46:59 +00:00
|
|
|
*/
|
|
|
|
|
2001-10-14 23:17:26 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
%{
|
|
|
|
/* need this for the call to atof() below */
|
|
|
|
#include <math.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2022-01-10 13:51:48 +00:00
|
|
|
#include "ac_cfg.h"
|
2007-01-24 21:07:54 +00:00
|
|
|
#include "avrdude.h"
|
2014-05-19 10:01:59 +00:00
|
|
|
#include "libavrdude.h"
|
2014-06-17 20:08:28 +00:00
|
|
|
#include "config.h"
|
2007-01-24 21:07:54 +00:00
|
|
|
|
2003-02-14 20:34:03 +00:00
|
|
|
#include "config_gram.h"
|
2001-10-14 23:17:26 +00:00
|
|
|
|
2012-01-31 17:03:43 +00:00
|
|
|
#ifndef YYERRCODE
|
|
|
|
#define YYERRCODE 256
|
|
|
|
#endif
|
|
|
|
|
2022-08-11 23:28:54 +00:00
|
|
|
/* capture lvalue keywords to associate comments with that assignment */
|
|
|
|
#define ccap() capture_lvalue_kw(yytext, cfg_lineno)
|
|
|
|
|
|
|
|
static void adjust_cfg_lineno(const char *p) {
|
|
|
|
while(*p)
|
|
|
|
if(*p++ == '\n')
|
|
|
|
cfg_lineno++;
|
|
|
|
}
|
|
|
|
|
2001-10-14 23:17:26 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
DIGIT [0-9]
|
|
|
|
HEXDIGIT [0-9a-fA-F]
|
|
|
|
SIGN [+-]
|
|
|
|
|
2012-01-30 20:31:29 +00:00
|
|
|
%option nounput
|
2001-10-14 23:17:26 +00:00
|
|
|
|
2005-11-02 21:49:52 +00:00
|
|
|
/* Bump resources for classic lex. */
|
|
|
|
%e2000
|
2009-02-22 21:36:24 +00:00
|
|
|
%p10000
|
2005-11-02 21:49:52 +00:00
|
|
|
%n1000
|
|
|
|
|
2001-10-14 23:17:26 +00:00
|
|
|
%%
|
|
|
|
|
2022-08-31 10:29:06 +00:00
|
|
|
{DIGIT}+ { yylval = new_number(yytext); return TKN_NUMBER; /* sign is treated in grammar */ }
|
Prepare for new components in avrdude.conf incl prog_modes
- Add prog_modes to part and programmer definitions; prog_mode is a bitwise
or of programming modes
+ PM_SPM: Bootloaders, self-programming with SPM/NVM Controllers
+ PM_TPI: t4, t5, t9, t10, t20, t40, t102, t104
+ PM_ISP: SPI programming for In-System Programming (typ classic parts)
+ PM_PDI: Program and Debug Interface (xmega parts)
+ PM_UPDI: Unified Program and Debug Interface
+ PM_HVSP: High Voltage Serial Programming (some classic parts)
+ PM_HVPP: High Voltage Parallel Programming (most non-HVSP classic parts)
+ PM_debugWIRE: Simpler alternative to JTAG (a subset of HVPP/HVSP parts)
+ PM_JTAG: some classic parts, some xmega
+ PM_aWire: AVR32 parts
- Add mcuid, a unique id in 0..2039, to part definition for urclock programmer
- Add n_interrupts, the number of interrupts, to part definition
- Add n_page_erase to part definition (# of pages erased during NVM erase)
- Implement a simple calculator in config_gram.y so numeric values can be
expressed as simple expressions such as PM_SPM | PM_UPDI
- Introduce a new method of assigning simple components to the grammar without
touching config_gram.y via an eligible-component list in config.c; numeric
expressions on the rhs of an assignment resolve to integer values
- Update documentation in avrdude.conf.in and avrdude.texi
2022-08-30 01:08:15 +00:00
|
|
|
{SIGN}?{DIGIT}+"."{DIGIT}* { yylval = new_number_real(yytext); return TKN_NUMBER_REAL; }
|
|
|
|
{SIGN}?"."{DIGIT}+ { yylval = new_number_real(yytext); return TKN_NUMBER_REAL; }
|
2001-10-14 23:17:26 +00:00
|
|
|
|
2022-08-09 20:20:44 +00:00
|
|
|
["]([^"\\\n]|\\.|\\\n)*["] {
|
|
|
|
char *str= cfg_strdup("lexer.l", yytext);
|
|
|
|
cfg_unescape(str, str+1);
|
|
|
|
size_t len = strlen(str);
|
|
|
|
if(len)
|
|
|
|
str[len-1] = 0;
|
Prepare for new components in avrdude.conf incl prog_modes
- Add prog_modes to part and programmer definitions; prog_mode is a bitwise
or of programming modes
+ PM_SPM: Bootloaders, self-programming with SPM/NVM Controllers
+ PM_TPI: t4, t5, t9, t10, t20, t40, t102, t104
+ PM_ISP: SPI programming for In-System Programming (typ classic parts)
+ PM_PDI: Program and Debug Interface (xmega parts)
+ PM_UPDI: Unified Program and Debug Interface
+ PM_HVSP: High Voltage Serial Programming (some classic parts)
+ PM_HVPP: High Voltage Parallel Programming (most non-HVSP classic parts)
+ PM_debugWIRE: Simpler alternative to JTAG (a subset of HVPP/HVSP parts)
+ PM_JTAG: some classic parts, some xmega
+ PM_aWire: AVR32 parts
- Add mcuid, a unique id in 0..2039, to part definition for urclock programmer
- Add n_interrupts, the number of interrupts, to part definition
- Add n_page_erase to part definition (# of pages erased during NVM erase)
- Implement a simple calculator in config_gram.y so numeric values can be
expressed as simple expressions such as PM_SPM | PM_UPDI
- Introduce a new method of assigning simple components to the grammar without
touching config_gram.y via an eligible-component list in config.c; numeric
expressions on the rhs of an assignment resolve to integer values
- Update documentation in avrdude.conf.in and avrdude.texi
2022-08-30 01:08:15 +00:00
|
|
|
yylval = new_string(str);
|
2022-08-09 20:20:44 +00:00
|
|
|
free(str);
|
|
|
|
return TKN_STRING;
|
|
|
|
}
|
2001-10-14 23:17:26 +00:00
|
|
|
|
Prepare for new components in avrdude.conf incl prog_modes
- Add prog_modes to part and programmer definitions; prog_mode is a bitwise
or of programming modes
+ PM_SPM: Bootloaders, self-programming with SPM/NVM Controllers
+ PM_TPI: t4, t5, t9, t10, t20, t40, t102, t104
+ PM_ISP: SPI programming for In-System Programming (typ classic parts)
+ PM_PDI: Program and Debug Interface (xmega parts)
+ PM_UPDI: Unified Program and Debug Interface
+ PM_HVSP: High Voltage Serial Programming (some classic parts)
+ PM_HVPP: High Voltage Parallel Programming (most non-HVSP classic parts)
+ PM_debugWIRE: Simpler alternative to JTAG (a subset of HVPP/HVSP parts)
+ PM_JTAG: some classic parts, some xmega
+ PM_aWire: AVR32 parts
- Add mcuid, a unique id in 0..2039, to part definition for urclock programmer
- Add n_interrupts, the number of interrupts, to part definition
- Add n_page_erase to part definition (# of pages erased during NVM erase)
- Implement a simple calculator in config_gram.y so numeric values can be
expressed as simple expressions such as PM_SPM | PM_UPDI
- Introduce a new method of assigning simple components to the grammar without
touching config_gram.y via an eligible-component list in config.c; numeric
expressions on the rhs of an assignment resolve to integer values
- Update documentation in avrdude.conf.in and avrdude.texi
2022-08-30 01:08:15 +00:00
|
|
|
0x{HEXDIGIT}+ { yylval = new_hexnumber(yytext); return TKN_NUMBER; }
|
2001-10-14 23:17:26 +00:00
|
|
|
|
2022-08-11 23:28:54 +00:00
|
|
|
#\n#\ PROGRAMMER\ DEFINITIONS\n#\n+ { /* Record comments so far as prologue and skip */
|
|
|
|
cfg_capture_prologue();
|
|
|
|
adjust_cfg_lineno(yytext);
|
|
|
|
}
|
|
|
|
|
|
|
|
#\n#\ PART\ DEFINITIONS\n#\n+ { /* Ignore part definions header */
|
|
|
|
adjust_cfg_lineno(yytext);
|
2022-08-08 15:52:09 +00:00
|
|
|
}
|
|
|
|
|
2022-08-11 23:28:54 +00:00
|
|
|
[ \t]*#[^\n]*\n+ { /* Record and skip # comments including preceding white space */
|
|
|
|
capture_comment_str(yytext, cfg_lineno);
|
|
|
|
adjust_cfg_lineno(yytext);
|
|
|
|
}
|
2022-08-08 15:52:09 +00:00
|
|
|
|
|
|
|
"/*" { /* The following eats multiline C style comments, they are not captured */
|
2001-10-14 23:17:26 +00:00
|
|
|
int c;
|
|
|
|
int comment_start;
|
|
|
|
|
2022-07-18 17:10:09 +00:00
|
|
|
comment_start = cfg_lineno;
|
2001-10-14 23:17:26 +00:00
|
|
|
while (1) {
|
|
|
|
while (((c = input()) != '*') && (c != EOF)) {
|
|
|
|
/* eat up text of comment, but keep counting lines */
|
|
|
|
if (c == '\n')
|
2022-07-18 17:10:09 +00:00
|
|
|
cfg_lineno++;
|
2001-10-14 23:17:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (c == '*') {
|
|
|
|
while ((c = input()) == '*')
|
|
|
|
;
|
|
|
|
if (c == '/')
|
|
|
|
break; /* found the end */
|
|
|
|
}
|
|
|
|
|
|
|
|
if (c == EOF) {
|
2014-06-17 20:08:28 +00:00
|
|
|
yyerror("EOF in comment (started on line %d)", comment_start);
|
|
|
|
return YYERRCODE;
|
2001-10-14 23:17:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-11-22 20:44:12 +00:00
|
|
|
(?x: prog_modes | mcuid | n_interrupts | n_page_erase | n_word_writes | n_boot_sections |
|
2022-11-27 16:56:49 +00:00
|
|
|
boot_section_size | autobaud_sync | idr | rampz | spmcr | eecr | eind ) { /* struct components */
|
2022-11-22 20:44:12 +00:00
|
|
|
|
Prepare for new components in avrdude.conf incl prog_modes
- Add prog_modes to part and programmer definitions; prog_mode is a bitwise
or of programming modes
+ PM_SPM: Bootloaders, self-programming with SPM/NVM Controllers
+ PM_TPI: t4, t5, t9, t10, t20, t40, t102, t104
+ PM_ISP: SPI programming for In-System Programming (typ classic parts)
+ PM_PDI: Program and Debug Interface (xmega parts)
+ PM_UPDI: Unified Program and Debug Interface
+ PM_HVSP: High Voltage Serial Programming (some classic parts)
+ PM_HVPP: High Voltage Parallel Programming (most non-HVSP classic parts)
+ PM_debugWIRE: Simpler alternative to JTAG (a subset of HVPP/HVSP parts)
+ PM_JTAG: some classic parts, some xmega
+ PM_aWire: AVR32 parts
- Add mcuid, a unique id in 0..2039, to part definition for urclock programmer
- Add n_interrupts, the number of interrupts, to part definition
- Add n_page_erase to part definition (# of pages erased during NVM erase)
- Implement a simple calculator in config_gram.y so numeric values can be
expressed as simple expressions such as PM_SPM | PM_UPDI
- Introduce a new method of assigning simple components to the grammar without
touching config_gram.y via an eligible-component list in config.c; numeric
expressions on the rhs of an assignment resolve to integer values
- Update documentation in avrdude.conf.in and avrdude.texi
2022-08-30 01:08:15 +00:00
|
|
|
Component_t *cp = cfg_comp_search(yytext, current_strct);
|
|
|
|
if(!cp) {
|
2023-01-02 21:48:53 +00:00
|
|
|
yyerror("unknown component %s in %s", yytext, cfg_strct_name(current_strct));
|
Prepare for new components in avrdude.conf incl prog_modes
- Add prog_modes to part and programmer definitions; prog_mode is a bitwise
or of programming modes
+ PM_SPM: Bootloaders, self-programming with SPM/NVM Controllers
+ PM_TPI: t4, t5, t9, t10, t20, t40, t102, t104
+ PM_ISP: SPI programming for In-System Programming (typ classic parts)
+ PM_PDI: Program and Debug Interface (xmega parts)
+ PM_UPDI: Unified Program and Debug Interface
+ PM_HVSP: High Voltage Serial Programming (some classic parts)
+ PM_HVPP: High Voltage Parallel Programming (most non-HVSP classic parts)
+ PM_debugWIRE: Simpler alternative to JTAG (a subset of HVPP/HVSP parts)
+ PM_JTAG: some classic parts, some xmega
+ PM_aWire: AVR32 parts
- Add mcuid, a unique id in 0..2039, to part definition for urclock programmer
- Add n_interrupts, the number of interrupts, to part definition
- Add n_page_erase to part definition (# of pages erased during NVM erase)
- Implement a simple calculator in config_gram.y so numeric values can be
expressed as simple expressions such as PM_SPM | PM_UPDI
- Introduce a new method of assigning simple components to the grammar without
touching config_gram.y via an eligible-component list in config.c; numeric
expressions on the rhs of an assignment resolve to integer values
- Update documentation in avrdude.conf.in and avrdude.texi
2022-08-30 01:08:15 +00:00
|
|
|
return YYERRCODE;
|
|
|
|
}
|
|
|
|
yylval = new_token(TKN_COMPONENT);
|
|
|
|
yylval->value.comp = cp;
|
|
|
|
ccap();
|
|
|
|
return TKN_COMPONENT;
|
|
|
|
}
|
|
|
|
|
2022-09-20 17:36:46 +00:00
|
|
|
PM_(SPM|TPI|ISP|PDI|UPDI|HVSP|HVPP|debugWIRE|JTAG|JTAGmkI|XMEGAJTAG|AVR32JTAG|aWire) { /* Constants */
|
Prepare for new components in avrdude.conf incl prog_modes
- Add prog_modes to part and programmer definitions; prog_mode is a bitwise
or of programming modes
+ PM_SPM: Bootloaders, self-programming with SPM/NVM Controllers
+ PM_TPI: t4, t5, t9, t10, t20, t40, t102, t104
+ PM_ISP: SPI programming for In-System Programming (typ classic parts)
+ PM_PDI: Program and Debug Interface (xmega parts)
+ PM_UPDI: Unified Program and Debug Interface
+ PM_HVSP: High Voltage Serial Programming (some classic parts)
+ PM_HVPP: High Voltage Parallel Programming (most non-HVSP classic parts)
+ PM_debugWIRE: Simpler alternative to JTAG (a subset of HVPP/HVSP parts)
+ PM_JTAG: some classic parts, some xmega
+ PM_aWire: AVR32 parts
- Add mcuid, a unique id in 0..2039, to part definition for urclock programmer
- Add n_interrupts, the number of interrupts, to part definition
- Add n_page_erase to part definition (# of pages erased during NVM erase)
- Implement a simple calculator in config_gram.y so numeric values can be
expressed as simple expressions such as PM_SPM | PM_UPDI
- Introduce a new method of assigning simple components to the grammar without
touching config_gram.y via an eligible-component list in config.c; numeric
expressions on the rhs of an assignment resolve to integer values
- Update documentation in avrdude.conf.in and avrdude.texi
2022-08-30 01:08:15 +00:00
|
|
|
yylval = new_constant(yytext);
|
|
|
|
return TKN_NUMBER;
|
|
|
|
}
|
|
|
|
|
Alias keyword (#868)
Implementation for an "alias" keyword.
By now, only applied inside memory descriptions.
* Make "mem_alias" a separate nonterminal.
The previous implementation attempt caused a syntax error in
yacc code, and separating mem_alias on the same level as
mem_spec appears to be the cleaner solution anyway.
* Maintain real memory aliases.
Instead of duplicating the aliased memory with a new name, maintain a
second list of memory aliases (per device) that contains a pointer to
the memory area it is aliased to. That way, a memory name can be
clearly distinguished between the canonical one and any aliases.
* Check p->mem_alias != NULL before touching it
* Add avr_find_memalias()
This takes a memory region as input, and searches whether an
alias can be found for it.
* We need to add a list structure for the mem_alias list, always.
By that means, mem_alias won't ever be NULL, so no need to check
later.
Also, in avr_dup_part(), duplicate the alias list.
* In a memory alias, actually remember the current name.
* In avr_dup_part(), adjust pointers of aliased memories
While walking the list of memories, for each entry, see if there is an
alias pointing to it. If so, allocate a duplicated one, and fix its
aliased_mem pointer to point to the duplicated memory region instead
of the original one.
* Add avr_locate_mem_noalias()
When looking whether any memory region has already been defined for
the current part while parsing the config file, only non-aliased names
must be considered. Otherwise, a newly defined alias would kick out
the memory definition it is being aliased to.
* When defining a mem_alias, drop any existing one of that name.
* Actually use avr_find_memalias() to find aliases
* Add declaration for avr_find_memalias()
* When defining a memory, also search for an existing alias
If the newly defined name has the same as an existing alias, the alias
can be removed.
Note that we do explicitly *not* remove any memory by the same name of
a later defined alias, as this might invalidate another alias'es
pointer. If someone defines that, the alias name just won't ever be
found by avr_locate_mem().
2022-02-10 19:39:19 +00:00
|
|
|
alias { yylval=NULL; return K_ALIAS; }
|
2022-08-11 23:28:54 +00:00
|
|
|
allowfullpagebitstream { yylval=NULL; ccap(); return K_ALLOWFULLPAGEBITSTREAM; }
|
|
|
|
avr910_devcode { yylval=NULL; ccap(); return K_AVR910_DEVCODE; }
|
2001-10-16 23:32:30 +00:00
|
|
|
bank_size { yylval=NULL; return K_PAGE_SIZE; }
|
|
|
|
banked { yylval=NULL; return K_PAGED; }
|
2022-08-11 23:28:54 +00:00
|
|
|
baudrate { yylval=NULL; ccap(); return K_BAUDRATE; }
|
|
|
|
blocksize { yylval=NULL; ccap(); return K_BLOCKSIZE; }
|
|
|
|
bs2 { yylval=NULL; ccap(); return K_BS2; }
|
|
|
|
buff { yylval=NULL; ccap(); return K_BUFF; }
|
|
|
|
bytedelay { yylval=NULL; ccap(); return K_BYTEDELAY; }
|
|
|
|
chip_erase { yylval=new_token(K_CHIP_ERASE); ccap(); return K_CHIP_ERASE; }
|
|
|
|
chip_erase_delay { yylval=NULL; ccap(); return K_CHIP_ERASE_DELAY; }
|
|
|
|
chiperasepolltimeout { yylval=NULL; ccap(); return K_CHIPERASEPOLLTIMEOUT; }
|
|
|
|
chiperasepulsewidth { yylval=NULL; ccap(); return K_CHIPERASEPULSEWIDTH; }
|
|
|
|
chiperasetime { yylval=NULL; ccap(); return K_CHIPERASETIME; }
|
|
|
|
cmdexedelay { yylval=NULL; ccap(); return K_CMDEXEDELAY; }
|
|
|
|
connection_type { yylval=NULL; ccap(); return K_CONNTYPE; }
|
2012-02-01 09:12:55 +00:00
|
|
|
dedicated { yylval=new_token(K_DEDICATED); return K_DEDICATED; }
|
|
|
|
default_bitclock { yylval=NULL; return K_DEFAULT_BITCLOCK; }
|
2003-02-21 18:46:51 +00:00
|
|
|
default_parallel { yylval=NULL; return K_DEFAULT_PARALLEL; }
|
2003-02-21 21:07:43 +00:00
|
|
|
default_programmer { yylval=NULL; return K_DEFAULT_PROGRAMMER; }
|
2003-02-21 18:46:51 +00:00
|
|
|
default_serial { yylval=NULL; return K_DEFAULT_SERIAL; }
|
2022-04-10 21:36:53 +00:00
|
|
|
default_spi { yylval=NULL; return K_DEFAULT_SPI; }
|
2022-08-11 23:28:54 +00:00
|
|
|
delay { yylval=NULL; ccap(); return K_DELAY; }
|
|
|
|
desc { yylval=NULL; ccap(); return K_DESC; }
|
|
|
|
devicecode { yylval=NULL; ccap(); return K_DEVICECODE; }
|
2001-10-14 23:17:26 +00:00
|
|
|
eeprom { yylval=NULL; return K_EEPROM; }
|
2022-08-11 23:28:54 +00:00
|
|
|
eeprom_instr { yylval=NULL; ccap(); return K_EEPROM_INSTR; }
|
|
|
|
enablepageprogramming { yylval=NULL; ccap(); return K_ENABLEPAGEPROGRAMMING; }
|
|
|
|
errled { yylval=NULL; ccap(); return K_ERRLED; }
|
|
|
|
family_id { yylval=NULL; ccap(); return K_FAMILY_ID; }
|
2001-10-14 23:17:26 +00:00
|
|
|
flash { yylval=NULL; return K_FLASH; }
|
2022-08-11 23:28:54 +00:00
|
|
|
flash_instr { yylval=NULL; ccap(); return K_FLASH_INSTR; }
|
|
|
|
has_debugwire { yylval=NULL; ccap(); return K_HAS_DW; }
|
|
|
|
has_jtag { yylval=NULL; ccap(); return K_HAS_JTAG; }
|
|
|
|
has_pdi { yylval=NULL; ccap(); return K_HAS_PDI; }
|
|
|
|
has_tpi { yylval=NULL; ccap(); return K_HAS_TPI; }
|
|
|
|
has_updi { yylval=NULL; ccap(); return K_HAS_UPDI; }
|
|
|
|
hventerstabdelay { yylval=NULL; ccap(); return K_HVENTERSTABDELAY; }
|
|
|
|
hvleavestabdelay { yylval=NULL; ccap(); return K_HVLEAVESTABDELAY; }
|
|
|
|
hvsp_controlstack { yylval=NULL; ccap(); return K_HVSP_CONTROLSTACK; }
|
|
|
|
hvspcmdexedelay { yylval=NULL; ccap(); return K_HVSPCMDEXEDELAY; }
|
|
|
|
hvupdi_support { yylval=NULL; ccap(); return K_HVUPDI_SUPPORT; }
|
|
|
|
hvupdi_variant { yylval=NULL; ccap(); return K_HVUPDI_VARIANT; }
|
|
|
|
id { yylval=NULL; ccap(); return K_ID; }
|
2012-02-01 09:12:55 +00:00
|
|
|
io { yylval=new_token(K_IO); return K_IO; }
|
2022-08-11 23:28:54 +00:00
|
|
|
is_at90s1200 { yylval=NULL; ccap(); return K_IS_AT90S1200; }
|
|
|
|
is_avr32 { yylval=NULL; ccap(); return K_IS_AVR32; }
|
|
|
|
latchcycles { yylval=NULL; ccap(); return K_LATCHCYCLES; }
|
|
|
|
load_ext_addr { yylval=new_token(K_LOAD_EXT_ADDR); ccap(); return K_LOAD_EXT_ADDR; }
|
|
|
|
loadpage_hi { yylval=new_token(K_LOADPAGE_HI); ccap(); return K_LOADPAGE_HI; }
|
|
|
|
loadpage_lo { yylval=new_token(K_LOADPAGE_LO); ccap(); return K_LOADPAGE_LO; }
|
|
|
|
max_write_delay { yylval=NULL; ccap(); return K_MAX_WRITE_DELAY; }
|
|
|
|
mcu_base { yylval=NULL; ccap(); return K_MCU_BASE; }
|
2023-01-02 21:48:53 +00:00
|
|
|
memory { yylval=NULL; ccap(); current_strct = COMP_AVRMEM; return K_MEMORY; }
|
2022-08-11 23:28:54 +00:00
|
|
|
min_write_delay { yylval=NULL; ccap(); return K_MIN_WRITE_DELAY; }
|
2022-11-22 17:04:05 +00:00
|
|
|
miso { yylval=NULL; ccap(); return K_SDI; } // Deprecated
|
2022-08-11 23:28:54 +00:00
|
|
|
mode { yylval=NULL; ccap(); return K_MODE; }
|
2022-11-22 17:04:05 +00:00
|
|
|
mosi { yylval=NULL; ccap(); return K_SDO; } // Deprecated
|
2012-02-01 09:12:55 +00:00
|
|
|
no { yylval=new_token(K_NO); return K_NO; }
|
2022-07-19 14:38:54 +00:00
|
|
|
NULL { yylval=NULL; return K_NULL; }
|
2001-10-16 23:32:30 +00:00
|
|
|
num_banks { yylval=NULL; return K_NUM_PAGES; }
|
2022-08-11 23:28:54 +00:00
|
|
|
num_pages { yylval=NULL; ccap(); return K_NUM_PAGES; }
|
|
|
|
nvm_base { yylval=NULL; ccap(); return K_NVM_BASE; }
|
|
|
|
ocd_base { yylval=NULL; ccap(); return K_OCD_BASE; }
|
|
|
|
ocdrev { yylval=NULL; ccap(); return K_OCDREV; }
|
|
|
|
offset { yylval=NULL; ccap(); return K_OFFSET; }
|
|
|
|
paged { yylval=NULL; ccap(); return K_PAGED; }
|
|
|
|
pagel { yylval=NULL; ccap(); return K_PAGEL; }
|
|
|
|
page_size { yylval=NULL; ccap(); return K_PAGE_SIZE; }
|
|
|
|
parallel { yylval=NULL; ccap(); return K_PARALLEL; }
|
2011-12-29 16:51:44 +00:00
|
|
|
parent { yylval=NULL; return K_PARENT; }
|
2023-01-02 21:48:53 +00:00
|
|
|
part { yylval=NULL; ccap(); current_strct = COMP_AVRPART; return K_PART; }
|
2022-08-11 23:28:54 +00:00
|
|
|
pgm_enable { yylval=new_token(K_PGM_ENABLE); ccap(); return K_PGM_ENABLE; }
|
|
|
|
pgmled { yylval=NULL; ccap(); return K_PGMLED; }
|
|
|
|
pollindex { yylval=NULL; ccap(); return K_POLLINDEX; }
|
|
|
|
pollmethod { yylval=NULL; ccap(); return K_POLLMETHOD; }
|
|
|
|
pollvalue { yylval=NULL; ccap(); return K_POLLVALUE; }
|
|
|
|
postdelay { yylval=NULL; ccap(); return K_POSTDELAY; }
|
|
|
|
poweroffdelay { yylval=NULL; ccap(); return K_POWEROFFDELAY; }
|
|
|
|
pp_controlstack { yylval=NULL; ccap(); return K_PP_CONTROLSTACK; }
|
|
|
|
predelay { yylval=NULL; ccap(); return K_PREDELAY; }
|
|
|
|
progmodedelay { yylval=NULL; ccap(); return K_PROGMODEDELAY; }
|
|
|
|
programfusepolltimeout { yylval=NULL; ccap(); return K_PROGRAMFUSEPOLLTIMEOUT; }
|
|
|
|
programfusepulsewidth { yylval=NULL; ccap(); return K_PROGRAMFUSEPULSEWIDTH; }
|
|
|
|
programlockpolltimeout { yylval=NULL; ccap(); return K_PROGRAMLOCKPOLLTIMEOUT; }
|
|
|
|
programlockpulsewidth { yylval=NULL; ccap(); return K_PROGRAMLOCKPULSEWIDTH; }
|
2023-01-02 21:48:53 +00:00
|
|
|
programmer { yylval=NULL; ccap(); current_strct = COMP_PROGRAMMER; return K_PROGRAMMER; }
|
2012-02-01 09:12:55 +00:00
|
|
|
pseudo { yylval=new_token(K_PSEUDO); return K_PSEUDO; }
|
2022-08-11 23:28:54 +00:00
|
|
|
pwroff_after_write { yylval=NULL; ccap(); return K_PWROFF_AFTER_WRITE; }
|
|
|
|
rdyled { yylval=NULL; ccap(); return K_RDYLED; }
|
|
|
|
read { yylval=new_token(K_READ); ccap(); return K_READ; }
|
|
|
|
read_hi { yylval=new_token(K_READ_HI); ccap(); return K_READ_HI; }
|
|
|
|
read_lo { yylval=new_token(K_READ_LO); ccap(); return K_READ_LO; }
|
|
|
|
readback { yylval=NULL; ccap(); return K_READBACK; }
|
|
|
|
readback_p1 { yylval=NULL; ccap(); return K_READBACK_P1; }
|
|
|
|
readback_p2 { yylval=NULL; ccap(); return K_READBACK_P2; }
|
|
|
|
readsize { yylval=NULL; ccap(); return K_READSIZE; }
|
|
|
|
reset { yylval=new_token(K_RESET); ccap(); return K_RESET; }
|
|
|
|
resetdelay { yylval=NULL; ccap(); return K_RESETDELAY; }
|
|
|
|
resetdelayms { yylval=NULL; ccap(); return K_RESETDELAYMS; }
|
|
|
|
resetdelayus { yylval=NULL; ccap(); return K_RESETDELAYUS; }
|
|
|
|
retry_pulse { yylval=NULL; ccap(); return K_RETRY_PULSE; }
|
|
|
|
sck { yylval=new_token(K_SCK); ccap(); return K_SCK; }
|
2022-11-22 17:04:05 +00:00
|
|
|
sdi { yylval=NULL; ccap(); return K_SDI; }
|
|
|
|
sdo { yylval=NULL; ccap(); return K_SDO; }
|
2022-08-11 23:28:54 +00:00
|
|
|
serial { yylval=NULL; ccap(); return K_SERIAL; }
|
|
|
|
signature { yylval=NULL; ccap(); return K_SIGNATURE; }
|
|
|
|
size { yylval=NULL; ccap(); return K_SIZE; }
|
2022-04-10 21:36:53 +00:00
|
|
|
spi { yylval=NULL; return K_SPI; }
|
2022-08-11 23:28:54 +00:00
|
|
|
stabdelay { yylval=NULL; ccap(); return K_STABDELAY; }
|
|
|
|
stk500_devcode { yylval=NULL; ccap(); return K_STK500_DEVCODE; }
|
|
|
|
synchcycles { yylval=NULL; ccap(); return K_SYNCHCYCLES; }
|
|
|
|
synchloops { yylval=NULL; ccap(); return K_SYNCHLOOPS; }
|
|
|
|
timeout { yylval=NULL; ccap(); return K_TIMEOUT; }
|
|
|
|
togglevtg { yylval=NULL; ccap(); return K_TOGGLEVTG; }
|
|
|
|
type { yylval=NULL; ccap(); return K_TYPE; }
|
2012-01-30 17:08:48 +00:00
|
|
|
usb { yylval=NULL; return K_USB; }
|
2022-08-11 23:28:54 +00:00
|
|
|
usbdev { yylval=NULL; ccap(); return K_USBDEV; }
|
|
|
|
usbpid { yylval=NULL; ccap(); return K_USBPID; }
|
|
|
|
usbproduct { yylval=NULL; ccap(); return K_USBPRODUCT; }
|
|
|
|
usbsn { yylval=NULL; ccap(); return K_USBSN; }
|
|
|
|
usbvendor { yylval=NULL; ccap(); return K_USBVENDOR; }
|
|
|
|
usbvid { yylval=NULL; ccap(); return K_USBVID; }
|
|
|
|
vcc { yylval=NULL; ccap(); return K_VCC; }
|
|
|
|
vfyled { yylval=NULL; ccap(); return K_VFYLED; }
|
|
|
|
write { yylval=new_token(K_WRITE); ccap(); return K_WRITE; }
|
|
|
|
write_hi { yylval=new_token(K_WRITE_HI); ccap(); return K_WRITE_HI; }
|
|
|
|
write_lo { yylval=new_token(K_WRITE_LO); ccap(); return K_WRITE_LO; }
|
|
|
|
writepage { yylval=new_token(K_WRITEPAGE); ccap(); return K_WRITEPAGE; }
|
2001-10-14 23:17:26 +00:00
|
|
|
yes { yylval=new_token(K_YES); return K_YES; }
|
|
|
|
|
|
|
|
"," { yylval = NULL; pyytext(); return TKN_COMMA; }
|
|
|
|
"=" { yylval = NULL; pyytext(); return TKN_EQUAL; }
|
|
|
|
";" { yylval = NULL; pyytext(); return TKN_SEMI; }
|
Prepare for new components in avrdude.conf incl prog_modes
- Add prog_modes to part and programmer definitions; prog_mode is a bitwise
or of programming modes
+ PM_SPM: Bootloaders, self-programming with SPM/NVM Controllers
+ PM_TPI: t4, t5, t9, t10, t20, t40, t102, t104
+ PM_ISP: SPI programming for In-System Programming (typ classic parts)
+ PM_PDI: Program and Debug Interface (xmega parts)
+ PM_UPDI: Unified Program and Debug Interface
+ PM_HVSP: High Voltage Serial Programming (some classic parts)
+ PM_HVPP: High Voltage Parallel Programming (most non-HVSP classic parts)
+ PM_debugWIRE: Simpler alternative to JTAG (a subset of HVPP/HVSP parts)
+ PM_JTAG: some classic parts, some xmega
+ PM_aWire: AVR32 parts
- Add mcuid, a unique id in 0..2039, to part definition for urclock programmer
- Add n_interrupts, the number of interrupts, to part definition
- Add n_page_erase to part definition (# of pages erased during NVM erase)
- Implement a simple calculator in config_gram.y so numeric values can be
expressed as simple expressions such as PM_SPM | PM_UPDI
- Introduce a new method of assigning simple components to the grammar without
touching config_gram.y via an eligible-component list in config.c; numeric
expressions on the rhs of an assignment resolve to integer values
- Update documentation in avrdude.conf.in and avrdude.texi
2022-08-30 01:08:15 +00:00
|
|
|
|
|
|
|
"|" { yylval = NULL; pyytext(); return OP_OR; }
|
|
|
|
"^" { yylval = NULL; pyytext(); return OP_XOR; }
|
|
|
|
"&" { yylval = NULL; pyytext(); return OP_AND; }
|
|
|
|
"+" { yylval = NULL; pyytext(); return OP_PLUS; }
|
|
|
|
"-" { yylval = NULL; pyytext(); return OP_MINUS; }
|
|
|
|
"*" { yylval = NULL; pyytext(); return OP_TIMES; }
|
|
|
|
"/" { yylval = NULL; pyytext(); return OP_DIVIDE; }
|
|
|
|
"%" { yylval = NULL; pyytext(); return OP_MODULO; }
|
|
|
|
"~" { yylval = NULL; pyytext(); return OP_TILDE; }
|
|
|
|
|
2012-11-13 21:34:02 +00:00
|
|
|
"(" { yylval = NULL; pyytext(); return TKN_LEFT_PAREN; }
|
|
|
|
")" { yylval = NULL; pyytext(); return TKN_RIGHT_PAREN; }
|
2001-10-14 23:17:26 +00:00
|
|
|
|
2022-07-18 17:10:09 +00:00
|
|
|
"\n" { cfg_lineno++; }
|
2005-11-02 21:49:52 +00:00
|
|
|
[ \r\t]+ { /* ignore whitespace */ }
|
2001-10-14 23:17:26 +00:00
|
|
|
|
2014-06-17 20:08:28 +00:00
|
|
|
c: { yyerror("possible old-style config file entry\n"
|
|
|
|
" Update your config file (see " CONFIG_DIR
|
|
|
|
"/avrdude.conf.sample for a sample)");
|
2012-01-31 17:03:43 +00:00
|
|
|
return YYERRCODE; }
|
2001-10-15 00:11:56 +00:00
|
|
|
|
2012-01-31 17:03:43 +00:00
|
|
|
. { return YYERRCODE; }
|
2001-10-14 23:17:26 +00:00
|
|
|
|
|
|
|
%%
|
|
|
|
|