Change serial pause/resume command to 'p'

This commit is contained in:
Satoshi N. M 2018-01-13 10:53:02 -08:00
parent 35ec39e13f
commit f53c02b815

View File

@ -83,10 +83,10 @@ static const char *usb_strings[] = {
"Pill 6502 UART Port", "Pill 6502 UART Port",
}; };
static bool running = false; static bool paused = true;
void sys_tick_handler(void) void sys_tick_handler(void)
{ {
if (!running) return; if (paused) return;
step6502(); step6502();
gpio_toggle(GPIOC, GPIO13); gpio_toggle(GPIOC, GPIO13);
} }
@ -102,9 +102,9 @@ char *process_serial_command(char *buf, int len) {
if (buf[0] == 'v') { if (buf[0] == 'v') {
return "Pill 6502 version " FIRMWARE_VERSION; return "Pill 6502 version " FIRMWARE_VERSION;
} else if (buf[0] == 'r') { } else if (buf[0] == 'p') {
running = !running; paused = !paused;
return running ? "resumed" : "paused"; return paused ? "paused" : "resumed";
} else if (buf[0] == 't') { } else if (buf[0] == 't') {
static char buf[64]; static char buf[64];
snprintf(buf, sizeof(buf), "%ld ticks\r\n%ld instructions", clockticks6502, instructions); snprintf(buf, sizeof(buf), "%ld ticks\r\n%ld instructions", clockticks6502, instructions);