void display_usage(char * app)
{
- printf("usage: %s [-t] [-g] [-m <device>] [-f <frequency>] firmware\n", app);
- printf(" -t: run full scale decoder trace\n"
- " -g: listen for gdb connection on port 1234\n"
- " -ff: Loads next .hex file as flash\n"
- " -ee: Loads next .hex file as eeprom\n"
+ printf("Usage: %s [-t] [-g] [-v] [-m <device>] [-f <frequency>] firmware\n", app);
+ printf(" -t: Run full scale decoder trace\n"
+ " -g: Listen for gdb connection on port 1234\n"
+ " -ff: Load next .hex file as flash\n"
+ " -ee: Load next .hex file as eeprom\n"
+ " -v: Raise verbosity level (can be passed more than once)\n"
" Supported AVR cores:\n");
for (int i = 0; avr_kind[i]; i++) {
printf(" ");
long f_cpu = 0;
int trace = 0;
int gdb = 0;
+ int log = 1;
char name[16] = "";
uint32_t loadBase = AVR_SEGMENT_OFFSET_FLASH;
int trace_vectors[8] = {0};
trace_vectors[trace_vectors_count++] = atoi(argv[++pi]);
} else if (!strcmp(argv[pi], "-g") || !strcmp(argv[pi], "-gdb")) {
gdb++;
+ } else if (!strcmp(argv[pi], "-v")) {
+ log++;
} else if (!strcmp(argv[pi], "-ee")) {
loadBase = AVR_SEGMENT_OFFSET_EEPROM;
} else if (!strcmp(argv[pi], "-ff")) {
printf("Attempted to load a bootloader at %04x\n", f.flashbase);
avr->pc = f.flashbase;
}
+ avr->log = (log > LOG_TRACE ? LOG_TRACE : log);
avr->trace = trace;
for (int ti = 0; ti < trace_vectors_count; ti++)
if (avr->interrupts.vector[trace_vectors[ti]])