forked from Imagelibrary/rtems
2011-09-16 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
* fileio/fileio.scn: New file. * capture/init.c, fileio/init.c: Use rtems_shell_wait_for_input().
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2011-09-16 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
|
||||
|
||||
* fileio/fileio.scn: New file.
|
||||
* capture/init.c, fileio/init.c: Use rtems_shell_wait_for_input().
|
||||
|
||||
2011-08-29 Joel Sherrill <joel.sherrilL@OARcorp.com>
|
||||
|
||||
* ticker/system.h: Remove unneeded include.
|
||||
|
||||
@@ -33,9 +33,18 @@
|
||||
#include <rtems.h>
|
||||
#include <rtems/capture-cli.h>
|
||||
#include <rtems/monitor.h>
|
||||
#include <rtems/shell.h>
|
||||
|
||||
volatile int can_proceed = 1;
|
||||
|
||||
static void notification(int fd, int seconds_remaining, void *arg)
|
||||
{
|
||||
printf(
|
||||
"Press any key to start capture engine (%is remaining)\n",
|
||||
seconds_remaining
|
||||
);
|
||||
}
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument ignored
|
||||
)
|
||||
@@ -43,27 +52,40 @@ rtems_task Init(
|
||||
#if BSP_SMALL_MEMORY
|
||||
printf("NO Capture Engine. MEMORY TOO SMALL");
|
||||
#else
|
||||
rtems_status_code status;
|
||||
rtems_task_priority old_priority;
|
||||
rtems_mode old_mode;
|
||||
|
||||
/* lower the task priority to allow created tasks to execute */
|
||||
puts( "\n\n*** TEST CAPTURE ENGINE ***" );
|
||||
|
||||
rtems_task_set_priority(RTEMS_SELF, 20, &old_priority);
|
||||
rtems_task_mode(RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode);
|
||||
status = rtems_shell_wait_for_input(
|
||||
STDIN_FILENO,
|
||||
20,
|
||||
notification,
|
||||
NULL
|
||||
);
|
||||
if (status == RTEMS_SUCCESSFUL) {
|
||||
/* lower the task priority to allow created tasks to execute */
|
||||
|
||||
printf( "\n*** CAPTURE ENGINE TEST ***\n" );
|
||||
rtems_task_set_priority(RTEMS_SELF, 20, &old_priority);
|
||||
rtems_task_mode(RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode);
|
||||
|
||||
while (!can_proceed)
|
||||
{
|
||||
printf ("Sleeping\n");
|
||||
usleep (1000000);
|
||||
while (!can_proceed)
|
||||
{
|
||||
printf ("Sleeping\n");
|
||||
usleep (1000000);
|
||||
}
|
||||
|
||||
rtems_monitor_init (0);
|
||||
rtems_capture_cli_init (0);
|
||||
|
||||
setup_tasks_to_watch ();
|
||||
|
||||
rtems_task_delete (RTEMS_SELF);
|
||||
} else {
|
||||
puts( "*** END OF TEST CAPTURE ENGINE ***" );
|
||||
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
rtems_monitor_init (0);
|
||||
rtems_capture_cli_init (0);
|
||||
|
||||
setup_tasks_to_watch ();
|
||||
|
||||
rtems_task_delete (RTEMS_SELF);
|
||||
#endif
|
||||
}
|
||||
|
||||
22
testsuites/samples/fileio/fileio.scn
Normal file
22
testsuites/samples/fileio/fileio.scn
Normal file
@@ -0,0 +1,22 @@
|
||||
*** TEST FILE I/O SAMPLE ***
|
||||
Press any key to start file I/O sample (20s remaining)
|
||||
Press any key to start file I/O sample (19s remaining)
|
||||
Press any key to start file I/O sample (18s remaining)
|
||||
Press any key to start file I/O sample (17s remaining)
|
||||
Press any key to start file I/O sample (16s remaining)
|
||||
Press any key to start file I/O sample (15s remaining)
|
||||
Press any key to start file I/O sample (14s remaining)
|
||||
Press any key to start file I/O sample (13s remaining)
|
||||
Press any key to start file I/O sample (12s remaining)
|
||||
Press any key to start file I/O sample (11s remaining)
|
||||
Press any key to start file I/O sample (10s remaining)
|
||||
Press any key to start file I/O sample (9s remaining)
|
||||
Press any key to start file I/O sample (8s remaining)
|
||||
Press any key to start file I/O sample (7s remaining)
|
||||
Press any key to start file I/O sample (6s remaining)
|
||||
Press any key to start file I/O sample (5s remaining)
|
||||
Press any key to start file I/O sample (4s remaining)
|
||||
Press any key to start file I/O sample (3s remaining)
|
||||
Press any key to start file I/O sample (2s remaining)
|
||||
Press any key to start file I/O sample (1s remaining)
|
||||
*** END OF TEST FILE I/O SAMPLE ***
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <rtems/ramdisk.h>
|
||||
#include <rtems/nvdisk.h>
|
||||
#include <rtems/nvdisk-sram.h>
|
||||
#include <rtems/shell.h>
|
||||
|
||||
#if FILEIO_BUILD
|
||||
|
||||
@@ -226,7 +227,6 @@ fstab_t fs_table[] = {
|
||||
#define USE_SHELL
|
||||
|
||||
#ifdef USE_SHELL
|
||||
#include <rtems/shell.h>
|
||||
|
||||
int
|
||||
shell_nvdisk_trace (int argc, char* argv[])
|
||||
@@ -1213,6 +1213,15 @@ fileio_task (rtems_task_argument ignored)
|
||||
fileio_menu();
|
||||
}
|
||||
|
||||
static void
|
||||
notification (int fd, int seconds_remaining, void *arg)
|
||||
{
|
||||
printf(
|
||||
"Press any key to start file I/O sample (%is remaining)\n",
|
||||
seconds_remaining
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* RTEMS Startup Task
|
||||
*/
|
||||
@@ -1223,22 +1232,34 @@ Init (rtems_task_argument ignored)
|
||||
rtems_id Task_id;
|
||||
rtems_status_code status;
|
||||
|
||||
puts( "\n\n*** FILE I/O SAMPLE AND TEST ***" );
|
||||
puts( "\n\n*** TEST FILE I/O SAMPLE ***" );
|
||||
|
||||
Task_name = rtems_build_name('F','M','N','U');
|
||||
|
||||
status = rtems_task_create(
|
||||
Task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2,
|
||||
RTEMS_DEFAULT_MODES ,
|
||||
RTEMS_FLOATING_POINT | RTEMS_DEFAULT_ATTRIBUTES, &Task_id
|
||||
status = rtems_shell_wait_for_input(
|
||||
STDIN_FILENO,
|
||||
20,
|
||||
notification,
|
||||
NULL
|
||||
);
|
||||
directive_failed( status, "create" );
|
||||
if (status == RTEMS_SUCCESSFUL) {
|
||||
Task_name = rtems_build_name('F','M','N','U');
|
||||
|
||||
status = rtems_task_start( Task_id, fileio_task, 1 );
|
||||
directive_failed( status, "start" );
|
||||
status = rtems_task_create(
|
||||
Task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2,
|
||||
RTEMS_DEFAULT_MODES ,
|
||||
RTEMS_FLOATING_POINT | RTEMS_DEFAULT_ATTRIBUTES, &Task_id
|
||||
);
|
||||
directive_failed( status, "create" );
|
||||
|
||||
status = rtems_task_delete( RTEMS_SELF );
|
||||
directive_failed( status, "delete" );
|
||||
status = rtems_task_start( Task_id, fileio_task, 1 );
|
||||
directive_failed( status, "start" );
|
||||
|
||||
status = rtems_task_delete( RTEMS_SELF );
|
||||
directive_failed( status, "delete" );
|
||||
} else {
|
||||
puts( "*** END OF TEST FILE I/O SAMPLE ***" );
|
||||
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(USE_SHELL)
|
||||
|
||||
Reference in New Issue
Block a user