Merge pull request #1174 from stefanrueger/default_programmer

Ensure default_programmer from config files is used
This commit is contained in:
Stefan Rueger 2022-11-22 01:17:55 +00:00 committed by GitHub
commit 3400527c7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -482,7 +482,7 @@ int main(int argc, char * argv [])
char * port; /* device port (/dev/xxx) */ char * port; /* device port (/dev/xxx) */
int terminal; /* 1=enter terminal mode, 0=don't */ int terminal; /* 1=enter terminal mode, 0=don't */
const char *exitspecs; /* exit specs string from command line */ const char *exitspecs; /* exit specs string from command line */
char * programmer; /* programmer id */ const char *programmer; /* programmer id */
char sys_config[PATH_MAX]; /* system wide config file */ char sys_config[PATH_MAX]; /* system wide config file */
char usr_config[PATH_MAX]; /* per-user config file */ char usr_config[PATH_MAX]; /* per-user config file */
char executable_abspath[PATH_MAX]; /* absolute path to avrdude executable */ char executable_abspath[PATH_MAX]; /* absolute path to avrdude executable */
@ -568,7 +568,7 @@ int main(int argc, char * argv [])
quell_progress = 0; quell_progress = 0;
exitspecs = NULL; exitspecs = NULL;
pgm = NULL; pgm = NULL;
programmer = cfg_strdup("main()", default_programmer); programmer = "";
verbose = 0; verbose = 0;
baudrate = 0; baudrate = 0;
bitclock = 0.0; bitclock = 0.0;
@ -954,6 +954,9 @@ int main(int argc, char * argv [])
bitclock = default_bitclock; bitclock = default_bitclock;
} }
if(!(programmer && *programmer) && *default_programmer)
programmer = cache_string(default_programmer);
// Developer options to print parts and/or programmer entries of avrdude.conf // Developer options to print parts and/or programmer entries of avrdude.conf
int dev_opt_c = dev_opt(programmer); // -c <wildcard>/[sSArt] int dev_opt_c = dev_opt(programmer); // -c <wildcard>/[sSArt]
int dev_opt_p = dev_opt(partdesc); // -p <wildcard>/[dsSArcow*t] int dev_opt_p = dev_opt(partdesc); // -p <wildcard>/[dsSArcow*t]