root/platform/a580/wrappers.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. lens_get_focus_pos
  2. lens_get_focus_pos_from_lens
  3. lens_get_target_distance
  4. camera_set_led
  5. DoMFLock
  6. UnlockMF

   1 #include "../generic/wrappers.c"
   2 
   3 long lens_get_focus_pos()
   4 {
   5     return _GetFocusLensSubjectDistance();
   6 }
   7 
   8 long lens_get_focus_pos_from_lens()
   9 {
  10     return _GetFocusLensSubjectDistanceFromLens();
  11 }
  12 
  13 
  14 long lens_get_target_distance()
  15 {
  16     return _GetCurrentTargetDistance();
  17 }
  18 
  19 void camera_set_led(int led, int state, __attribute__ ((unused))int bright)
  20 {
  21         // 0 gr
  22         // 1 orange
  23         // 2 yel
  24         // 8 dp
  25         // 9 af
  26 
  27   int leds[] = {0,2,8,1,8,9};
  28   if(led < 4 || led > 9 || led == 6) return;
  29   _LEDDrive(leds[led-4], state<=1 ? !state : state);
  30 }
  31  
  32  //--------------------------------------------------
  33  // DoMFLock : use _MFOn/_MFOff  or  _PT_MFOn/_PT_MFOff  or _SS_MFOn/_SS_MFOff if defined in stubs_entry.S
  34  //            otherwise use PostLogicalEventForNotPowerType(levent_id_for_name(PressSW1andMF),0); (see sx500hs for an example)
  35  
  36 int DoMFLock(void)
  37 {
  38   if (!camera_info.state.mode_play) {
  39      int mf_lock;
  40      get_property_case(PROPCASE_FOCUS_MODE,&mf_lock,sizeof(mf_lock));
  41      if( mf_lock == 0 ) PostLogicalEventForNotPowerType(levent_id_for_name("PressSw1AndMF"),0);
  42      return(1);
  43   }
  44   return(0);
  45 }
  46  
  47 int UnlockMF(void)
  48 {
  49   if (!camera_info.state.mode_play) {
  50      int mf_lock;
  51      get_property_case(PROPCASE_FOCUS_MODE,&mf_lock,sizeof(mf_lock));
  52      if( mf_lock == 1 ) PostLogicalEventForNotPowerType(levent_id_for_name("PressSw1AndMF"),0);
  53      return(1);
  54   }
  55   return(0);
  56 }

/* [<][>][^][v][top][bottom][index][help] */