| Line | |
|---|
| 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 | long 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 | |
|---|
| 23 | static unsigned int next = 1; |
|---|
| 24 | |
|---|
| 25 | int rand_r(unsigned int *seed) |
|---|
| 26 | { |
|---|
| 27 | *seed = *seed * 1103515245 + 12345; |
|---|
| 28 | return (*seed % ((unsigned int) RAND_MAX + 1)); |
|---|
| 29 | } |
|---|
| 30 | |
|---|
| 31 | int _rand(void) |
|---|
| 32 | { |
|---|
| 33 | return (rand_r(&next)); |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | void* _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.