Add a wait for key press to test rccof02.

This commit is contained in:
Chris Johns
2016-07-01 16:36:13 +10:00
parent 65c65bb7a3
commit 4dec435385

View File

@@ -148,20 +148,41 @@ test_rc_conf_script(void)
}
static void
test_main(void)
waiter(int fd, int secs, void *arg)
{
test_rc_conf_script();
int* toggle = (int*) arg;
const char* toggles = "|/-|\-";
printf("\b%c", toggles[*toggle]);
fflush(stdout);
++(*toggle);
if (*toggle >= 6)
*toggle = 0;
}
rtems_shell_init(
"SHLL",
static void
shell(void)
{
int toggle = 1;
rtems_status_code sc;
printf("Press any key for the shell .... -");
fflush(stdout);
sc = rtems_shell_wait_for_input(STDIN_FILENO, 10, waiter, &toggle);
if (sc == RTEMS_SUCCESSFUL) {
rtems_shell_init("SHLL",
32 * 1024,
1,
CONSOLE_DEVICE_NAME,
false,
true,
NULL
);
NULL);
}
}
static void
test_main(void)
{
test_rc_conf_script();
shell();
exit(0);
}