Changeset 553

Show
Ignore:
Timestamp:
03/16/08 15:13:21 (4 months ago)
Author:
anthony_rowe
Message:

add FS command to CMUcam2 emulation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/projects/cmucam2/cmucam2.c

    r523 r553  
    9898  COLOR_SPACE, 
    9999  HIRES_DIFF, 
     100  FRAME_STREAM, 
    100101 
    101102  RETURN,                       // Must be second to last 
     
    117118  /* Data Rate Commands */ 
    118119  //  DM delay mode 
     120  [FRAME_STREAM] = "FS", 
    119121  [POLL_MODE] = "PM", 
    120122  //  PS packet skip 
     
    228230  uint32_t start_time; 
    229231  uint8_t sw_color_space; 
    230   bool error, poll_mode, auto_led, demo_mode, buf_mode
     232  bool error, poll_mode, auto_led, demo_mode, buf_mode,frame_stream_mode
    231233  int8_t line_mode; 
    232234  cc3_track_pkt_t t_pkt; 
     
    281283  auto_led = true; 
    282284  poll_mode = false; 
     285  frame_stream_mode = false; 
    283286  line_mode = 0; 
    284287  buf_mode = false; 
     
    465468        break; 
    466469 
     470         
     471      case FRAME_STREAM: 
     472        if (n != 1 || arg_list[0] > 1) { 
     473          error = true; 
     474          break; 
     475        } 
     476 
     477        print_ACK (); 
     478        if (arg_list[0] == 1) 
     479          frame_stream_mode = true; 
     480        else 
     481          frame_stream_mode = false; 
     482        break; 
     483 
    467484      case SERVO_PARAMETERS: 
    468485        if (n != 6) { 
     
    652669 
    653670        print_ACK (); 
    654         cmucam2_send_image_direct (auto_led,sw_color_space); 
     671        do { 
     672                cmucam2_send_image_direct (auto_led,sw_color_space); 
     673                // Check to see if data is on the UART to break from frame_stream_mode 
     674                if (!cc3_uart_has_data (0)) { 
     675                if (getchar () == '\r') 
     676                        break; 
     677                } 
     678        } while (frame_stream_mode); 
     679         
    655680        cc3_pixbuf_frame_set_coi (old_coi); 
    656681        break;