Changeset 445

Show
Ignore:
Timestamp:
02/18/07 19:26:22 (2 years ago)
Author:
goodea
Message:

camera power
also, API versioning

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/cc3.h

    r431 r445  
    3030 
    3131/** 
    32  * Version number of API. 
    33  */ 
    34 #define CC3_API_VERSION  1 
    35  
    36  
    37 /** 
    38  * Mark a boolean expression as "likely". 
    39  * This is sometimes useful for assisting the compiler in predicting branches. 
    40  */ 
    41 #define likely(x)   __builtin_expect(x,1) 
    42  
    43 /** 
    44  * Mark a boolean expression as "unlikely". 
    45  * This is sometimes useful for assisting the compiler in predicting branches. 
    46  */ 
    47 #define unlikely(x) __builtin_expect(x,0) 
     32 * Major version number of API. This is incremented when 
     33 * backwards-incompatible changes are made in a release. 
     34 */ 
     35#define CC3_API_MAJOR_VERSION  1 
     36 
     37/** 
     38 * Minor version number of API. This is incremented when compatible 
     39 * new features are added in a release. 
     40 */ 
     41#define CC3_API_MINOR_VERSION  0 
     42 
    4843 
    4944/** 
     
    294289 
    295290/** 
    296  * Turn off power to the camera and pixbuf. To use the camera again, 
    297  * call cc3_camera_init(). 
    298  * \note This may cause the image to evaporate. 
    299  */ 
    300 void cc3_camera_disable (void); 
     291 * Set the power state of the camera and (possibly) pixbuf. Used to 
     292 * conserve power when the camera is not being used. 
     293 * 
     294 * \note If state is set to \a false, the camera will not work. 
     295 * 
     296 * @param[in] state Set to \a true for normal operation, 
     297 * set to \a false to disable power to the camera. 
     298 */ 
     299void cc3_camera_set_power_state (bool state); 
    301300 
    302301/** 
  • trunk/projects/cmucam2/cmucam2.c

    r443 r445  
    4949  SET_SERVO, 
    5050  CAMERA_REG, 
     51  CAMERA_POWER, 
    5152  POLL_MODE, 
    5253  LINE_MODE, 
     
    101102  /* Camera Module Commands */ 
    102103  cmucam2_cmds[CAMERA_REG] = "CR"; 
    103   //  CP camera power 
     104  cmucam2_cmds[CAMERA_POWER] = "CP"; 
    104105  //  CT camera type 
    105106 
     
    273274 
    274275 
     276  cc3_camera_set_power_state (true); 
    275277  cc3_camera_set_resolution (CC3_CAMERA_RESOLUTION_LOW); 
    276278 
     
    556558        break; 
    557559 
     560      case CAMERA_POWER: 
     561        if (n != 1) { 
     562          error = true; 
     563          break; 
     564        } 
     565 
     566        print_ACK (); 
     567        cc3_camera_set_power_state(arg_list[0]); 
     568        break; 
    558569 
    559570      case VIRTUAL_WINDOW: