Changeset 7c9d27e in rtems
- Timestamp:
- 09/16/11 09:23:19 (12 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 11b9b5d
- Parents:
- 6c5ee7f0
- Location:
- testsuites/samples
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
testsuites/samples/ChangeLog
r6c5ee7f0 r7c9d27e 1 2011-09-16 Sebastian Huber <Sebastian.Huber@embedded-brains.de> 2 3 * fileio/fileio.scn: New file. 4 * capture/init.c, fileio/init.c: Use rtems_shell_wait_for_input(). 5 1 6 2011-08-29 Joel Sherrill <joel.sherrilL@OARcorp.com> 2 7 -
testsuites/samples/capture/init.c
r6c5ee7f0 r7c9d27e 34 34 #include <rtems/capture-cli.h> 35 35 #include <rtems/monitor.h> 36 #include <rtems/shell.h> 36 37 37 38 volatile int can_proceed = 1; 39 40 static void notification(int fd, int seconds_remaining, void *arg) 41 { 42 printf( 43 "Press any key to start capture engine (%is remaining)\n", 44 seconds_remaining 45 ); 46 } 38 47 39 48 rtems_task Init( … … 44 53 printf("NO Capture Engine. MEMORY TOO SMALL"); 45 54 #else 55 rtems_status_code status; 46 56 rtems_task_priority old_priority; 47 57 rtems_mode old_mode; 48 58 49 /* lower the task priority to allow created tasks to execute */59 puts( "\n\n*** TEST CAPTURE ENGINE ***" ); 50 60 51 rtems_task_set_priority(RTEMS_SELF, 20, &old_priority); 52 rtems_task_mode(RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode); 61 status = rtems_shell_wait_for_input( 62 STDIN_FILENO, 63 20, 64 notification, 65 NULL 66 ); 67 if (status == RTEMS_SUCCESSFUL) { 68 /* lower the task priority to allow created tasks to execute */ 53 69 54 printf( "\n*** CAPTURE ENGINE TEST ***\n" ); 70 rtems_task_set_priority(RTEMS_SELF, 20, &old_priority); 71 rtems_task_mode(RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode); 55 72 56 while (!can_proceed) 57 { 58 printf ("Sleeping\n"); 59 usleep (1000000); 73 while (!can_proceed) 74 { 75 printf ("Sleeping\n"); 76 usleep (1000000); 77 } 78 79 rtems_monitor_init (0); 80 rtems_capture_cli_init (0); 81 82 setup_tasks_to_watch (); 83 84 rtems_task_delete (RTEMS_SELF); 85 } else { 86 puts( "*** END OF TEST CAPTURE ENGINE ***" ); 87 88 exit( 0 ); 60 89 } 61 62 rtems_monitor_init (0);63 rtems_capture_cli_init (0);64 65 setup_tasks_to_watch ();66 67 rtems_task_delete (RTEMS_SELF);68 90 #endif 69 91 } -
testsuites/samples/fileio/init.c
r6c5ee7f0 r7c9d27e 44 44 #include <rtems/nvdisk.h> 45 45 #include <rtems/nvdisk-sram.h> 46 #include <rtems/shell.h> 46 47 47 48 #if FILEIO_BUILD … … 227 228 228 229 #ifdef USE_SHELL 229 #include <rtems/shell.h>230 230 231 231 int … … 1214 1214 } 1215 1215 1216 static void 1217 notification (int fd, int seconds_remaining, void *arg) 1218 { 1219 printf( 1220 "Press any key to start file I/O sample (%is remaining)\n", 1221 seconds_remaining 1222 ); 1223 } 1224 1216 1225 /* 1217 1226 * RTEMS Startup Task … … 1224 1233 rtems_status_code status; 1225 1234 1226 puts( "\n\n*** FILE I/O SAMPLE AND TEST ***" ); 1227 1228 Task_name = rtems_build_name('F','M','N','U'); 1229 1230 status = rtems_task_create( 1231 Task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2, 1232 RTEMS_DEFAULT_MODES , 1233 RTEMS_FLOATING_POINT | RTEMS_DEFAULT_ATTRIBUTES, &Task_id 1235 puts( "\n\n*** TEST FILE I/O SAMPLE ***" ); 1236 1237 status = rtems_shell_wait_for_input( 1238 STDIN_FILENO, 1239 20, 1240 notification, 1241 NULL 1234 1242 ); 1235 directive_failed( status, "create" ); 1236 1237 status = rtems_task_start( Task_id, fileio_task, 1 ); 1238 directive_failed( status, "start" ); 1239 1240 status = rtems_task_delete( RTEMS_SELF ); 1241 directive_failed( status, "delete" ); 1243 if (status == RTEMS_SUCCESSFUL) { 1244 Task_name = rtems_build_name('F','M','N','U'); 1245 1246 status = rtems_task_create( 1247 Task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2, 1248 RTEMS_DEFAULT_MODES , 1249 RTEMS_FLOATING_POINT | RTEMS_DEFAULT_ATTRIBUTES, &Task_id 1250 ); 1251 directive_failed( status, "create" ); 1252 1253 status = rtems_task_start( Task_id, fileio_task, 1 ); 1254 directive_failed( status, "start" ); 1255 1256 status = rtems_task_delete( RTEMS_SELF ); 1257 directive_failed( status, "delete" ); 1258 } else { 1259 puts( "*** END OF TEST FILE I/O SAMPLE ***" ); 1260 1261 rtems_test_exit( 0 ); 1262 } 1242 1263 } 1243 1264
Note: See TracChangeset
for help on using the changeset viewer.