Ignore:
Timestamp:
09/16/11 09:24:52 (11 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
3ce764a
Parents:
7c9d27e
Message:

2011-09-16 Sebastian Huber <Sebastian.Huber@…>

  • monitor/monitor.scn, termios/termios.scn: New files.
  • monitor/init.c, termios01/init.c: Use rtems_shell_wait_for_input().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/monitor/init.c

    r7c9d27e r11b9b5d  
    2222
    2323#include <rtems/monitor.h>
     24#include <rtems/shell.h>
    2425
    2526rtems_task_priority Priorities[6] = { 0,   1,   1,   3,   4,   5 };
     
    3738}
    3839
    39 
     40static void notification(int fd, int seconds_remaining, void *arg)
     41{
     42  printf(
     43    "Press any key to enter monitor (%is remaining)\n",
     44    seconds_remaining
     45  );
     46}
    4047
    4148rtems_task Init(
     
    4653  rtems_status_code status;
    4754
    48   puts( "\n\n*** MONITOR TASK TEST ***" );
     55  puts( "\n\n*** TEST MONITOR ***" );
    4956
    5057  Task_name[ 1 ] =  rtems_build_name( 'T', 'A', '1', ' ' );
     
    7178  }
    7279
    73   rtems_monitor_init( 0 );
     80  status = rtems_shell_wait_for_input(
     81    STDIN_FILENO,
     82    20,
     83    notification,
     84    NULL
     85  );
     86  if (status == RTEMS_SUCCESSFUL) {
     87    rtems_monitor_init( 0 );
    7488
    75   status = rtems_task_delete( RTEMS_SELF );
    76   directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
     89    status = rtems_task_delete( RTEMS_SELF );
     90    directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
     91  } else {
     92    puts( "*** END OF TEST MONITOR ***" );
     93
     94    rtems_test_exit( 0 );
     95  }
    7796}
Note: See TracChangeset for help on using the changeset viewer.