source: trunk/platform/g12/wrappers.c @ 1008

Revision 1008, 655 bytes checked in by reyalP, 2 years ago (diff)

sx30 100e, 100h, 100l and g12 100c support from from philmoz in http://chdk.setepontos.com/index.php?topic=650.msg59036#msg59036
not added to autobuild yet

  • Property svn:eol-style set to native
Line 
1#include "../generic/wrappers.c"
2
3long lens_get_focus_pos()
4{
5        return _GetFocusLensSubjectDistance();
6}
7
8long lens_get_focus_pos_from_lens()
9{
10        return _GetFocusLensSubjectDistanceFromLens();
11}
12
13long lens_get_target_distance()
14{
15        return _GetCurrentTargetDistance();
16}
17
18
19// G12 firmware does not include rand(), srand() so we add them here
20
21#define RAND_MAX 0x7fffffff
22
23static unsigned int next = 1;
24
25int rand_r(unsigned int *seed)
26{
27        *seed = *seed * 1103515245 + 12345;
28        return (*seed % ((unsigned int) RAND_MAX + 1));
29}
30
31int _rand(void)
32{
33        return (rand_r(&next));
34}
35
36void* _srand(unsigned int seed)
37{
38        next = seed;
39        return 0;                               // unused return value
40}
Note: See TracBrowser for help on using the repository browser.