qmod: breal the command loop when 'U' is pressed and proceed to USB init

This commit is contained in:
Harald Welte 2017-01-11 22:22:16 +01:00
parent afbb747170
commit f9a182d24d
1 changed files with 6 additions and 3 deletions

View File

@ -175,7 +175,8 @@ static int write_hub_eeprom(void)
return 0;
}
static void check_exec_dbg_cmd(void)
/* returns '1' in case we should break any endless loop */
static int check_exec_dbg_cmd(void)
{
uint32_t addr, val;
@ -257,11 +258,12 @@ static void check_exec_dbg_cmd(void)
break;
case 'U':
printf("Proceeding to USB init\r\n");
return;
return 1;
default:
printf("Unknown command '%c'\r\n", ch);
break;
}
return 0;
}
/*------------------------------------------------------------------------------
@ -312,7 +314,8 @@ extern int main(void)
}
while (1) {
check_exec_dbg_cmd();
if (check_exec_dbg_cmd() == 1)
break;
}
TRACE_INFO("USB init...\r\n");