Ignore:
Timestamp:
03/17/12 02:32:01 (15 months ago)
Author:
philmoz
Message:

A few updates:

  • increase auto ISO max allowed value from 800 to 3200
  • fix auto ISO bug where values not always initialised correctly
  • fix strrchr for SX10 1.00c (thx srsa_4c)
  • add DNG_LENS_INFO for SX210, signature finder now finds focus len table in firmware
  • update SX210 (main.c) to use firmware focus len table (thx srsa_4c for pointing out mistake in prev table)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/release-1_0/platform/sx210is/main.c

    r1738 r1739  
    3333 
    3434//zoom position is get_parameter_data(87) 
    35 static const struct { 
    36         int zp, fl; 
    37 } fl_tbl[] = { 
    38   {   0,   5000}, 
    39   {  16,   6800}, 
    40   {  32,   9100}, 
    41   {  62,  16200}, 
    42   {  78,  22300}, 
    43   { 102,  35900}, 
    44   { 125,  70000}, 
    45 }; 
    46 #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0])) 
    4735 
     36// Focus length table in firmware @ 0xfffea1cc 
     37#define NUM_FL 126              // 0 - 125, entries in firmware (3 words each entry, first is FL) 
     38extern int focus_len_table[NUM_FL*3]; 
    4839 
    4940// Focal length range is 5.0 - 70,0 mm, 27.3 - 392 in 35-mm equivalent. 
     
    5344// divide by 10 to avoid overflow in get_effective_focal_length() 
    5445#define CF_EFL  5670 
    55 const int zoom_points = 126; 
     46const int zoom_points = NUM_FL; 
    5647 
    5748int get_effective_focal_length(int zp) { 
     
    6051 
    6152int get_focal_length(int zp) { 
    62         int i; 
    63  
    64         if (zp<fl_tbl[0].zp) 
    65                 return fl_tbl[0].fl; 
    66         else if (zp>fl_tbl[NUM_FL-1].zp) 
    67                 return fl_tbl[NUM_FL-1].fl; 
    68         else 
    69                 for (i=1; i<NUM_FL; ++i) { 
    70                         if (zp==fl_tbl[i-1].zp) 
    71                                 return fl_tbl[i-1].fl; 
    72                         else if (zp==fl_tbl[i].zp) 
    73                                 return fl_tbl[i].fl; 
    74                         else if (zp<fl_tbl[i].zp) 
    75                                 return fl_tbl[i-1].fl+(zp-fl_tbl[i-1].zp)*(fl_tbl[i].fl-fl_tbl[i-1].fl)/(fl_tbl[i].zp-fl_tbl[i-1].zp); 
    76                 } 
    77         return fl_tbl[NUM_FL-1].fl; 
     53        if (zp < 0) zp = 0; 
     54        else if (zp >= NUM_FL) zp = NUM_FL-1; 
     55        return focus_len_table[zp*3]; 
    7856} 
    7957 
    8058int get_zoom_x(int zp) { 
    81         return get_focal_length(zp)*10/fl_tbl[0].fl; 
     59        return get_focal_length(zp)*10/focus_len_table[0]; 
    8260} 
    8361 
Note: See TracChangeset for help on using the changeset viewer.