Mercurial > ecos
comparison packages/redboot/current/src/main.c @ 195:67850532eebb
Merge from eCos master repository on 2001-11-02-06:43:03-GMT
| author | jlarmour |
|---|---|
| date | Fri, 02 Nov 2001 16:12:33 +0000 |
| parents | 678094f34118 |
| children | 9b55e9c69693 |
comparison
equal
deleted
inserted
replaced
| 194:feb0fcf83327 | 195:67850532eebb |
|---|---|
| 283 while (true) { | 283 while (true) { |
| 284 if (prompt) { | 284 if (prompt) { |
| 285 diag_printf("RedBoot> "); | 285 diag_printf("RedBoot> "); |
| 286 prompt = false; | 286 prompt = false; |
| 287 } | 287 } |
| 288 #if CYGNUM_REDBOOT_CMD_LINE_EDITING != 0 | |
| 289 cmd_history = true; // Enable history collection | |
| 290 #endif | |
| 288 res = _rb_gets(line, sizeof(line), CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT); | 291 res = _rb_gets(line, sizeof(line), CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT); |
| 292 #if CYGNUM_REDBOOT_CMD_LINE_EDITING != 0 | |
| 293 cmd_history = false; // Enable history collection | |
| 294 #endif | |
| 289 if (res == _GETS_TIMEOUT) { | 295 if (res == _GETS_TIMEOUT) { |
| 290 // No input arrived | 296 // No input arrived |
| 291 } else { | 297 } else { |
| 292 #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS | 298 #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS |
| 293 if (res == _GETS_GDB) { | 299 if (res == _GETS_GDB) { |
| 316 { | 322 { |
| 317 #ifdef CYGSEM_REDBOOT_FLASH_ALIASES | 323 #ifdef CYGSEM_REDBOOT_FLASH_ALIASES |
| 318 expand_aliases(line, sizeof(line)); | 324 expand_aliases(line, sizeof(line)); |
| 319 #endif | 325 #endif |
| 320 command = (char *)&line; | 326 command = (char *)&line; |
| 321 while (strlen(command) > 0) { | 327 if ((*command == '#') || (*command == '=')) { |
| 322 if ((cmd = parse(&command, &argc, &argv[0])) != (struct cmd *)0) { | 328 // Special cases |
| 323 (cmd->fun)(argc, argv); | 329 if (*command == '=') { |
| 324 } else { | 330 // Print line on console |
| 325 diag_printf("** Error: Illegal command: \"%s\"\n", argv[0]); | 331 diag_printf("%s\n", &line[2]); |
| 332 } | |
| 333 } else { | |
| 334 while (strlen(command) > 0) { | |
| 335 if ((cmd = parse(&command, &argc, &argv[0])) != (struct cmd *)0) { | |
| 336 (cmd->fun)(argc, argv); | |
| 337 } else { | |
| 338 diag_printf("** Error: Illegal command: \"%s\"\n", argv[0]); | |
| 339 } | |
| 326 } | 340 } |
| 327 } | 341 } |
| 328 prompt = true; | 342 prompt = true; |
| 329 } | 343 } |
| 330 } | 344 } |
