forked from 400plus/400plus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fexp.c
43 lines (32 loc) · 864 Bytes
/
fexp.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <vxworks.h>
#include "firmware.h"
#include "firmware/camera.h"
#include "main.h"
#include "macros.h"
#include "exposure.h"
#include "utils.h"
#include "intercom.h"
#include "fexp.h"
void fexp_enable(void) {
status.vf_status = VF_STATUS_FEXP;
status.fexp_ev = (int)DPData.av_val + (int)DPData.tv_val;
}
void fexp_disable(void) {
status.vf_status = VF_STATUS_NONE;
}
void fexp_update_av(void) {
if (DPData.ae == AE_MODE_M && DPData.tv_val != TV_VAL_BULB) {
int av = status.fexp_ev - DPData.tv_val;
av = CLAMP(av, AV_MIN, AV_MAX);
av = ev_normalize(av);
send_to_intercom(IC_SET_AV_VAL, av);
}
}
void fexp_update_tv(void) {
if (DPData.ae == AE_MODE_M && DPData.tv_val != TV_VAL_BULB) {
int tv = status.fexp_ev - DPData.av_val;
tv = CLAMP(tv, TV_MIN, TV_MAX);
tv = ev_normalize(tv);
send_to_intercom(IC_SET_TV_VAL, tv);
}
}