forked from 400plus/400plus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathactions.c
88 lines (71 loc) · 1.76 KB
/
actions.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include <vxworks.h>
#include <dirent.h>
#include <stdio.h>
#include "firmware.h"
#include "macros.h"
#include "main.h"
#include "bmp.h"
#include "debug.h"
#include "display.h"
#include "exposure.h"
#include "languages.h"
#include "memspy.h"
#include "menu_main.h"
#include "persist.h"
#include "scripts.h"
#include "settings.h"
#include "utils.h"
#include "intercom.h"
#include "actions.h"
void set_metering_spot() {
press_button(IC_BUTTON_SET);
send_to_intercom(IC_SET_METERING, METERING_MODE_SPOT);
print_icu_info();
beep();
}
void set_whitebalance_colortemp() {
press_button(IC_BUTTON_SET);
send_to_intercom(IC_SET_WB, WB_MODE_COLORTEMP);
print_icu_info();
beep();
}
void drivemode_set() {
if (settings.remote_enable) {
debug_log("Re-setting IR remote => enable");
remote_on();
}
if (settings.remote_delay) {
debug_log("Re-setting IR remote => delay");
remote_delay(TRUE);
}
}
void toggle_img_format() {
static int first_call = TRUE;
if (!first_call && AE_IS_AUTO(DPData.ae)) {
switch (DPData.img_format) {
case IMG_FORMAT_JPG:
send_to_intercom(IC_SET_IMG_FORMAT, IMG_FORMAT_RAW);
break;
case IMG_FORMAT_RAW:
send_to_intercom(IC_SET_IMG_FORMAT, IMG_FORMAT_JPG | IMG_FORMAT_RAW);
break;
case IMG_FORMAT_JPG | IMG_FORMAT_RAW:
send_to_intercom(IC_SET_IMG_FORMAT, IMG_FORMAT_JPG);
break;
}
send_to_intercom(IC_SET_IMG_QUALITY, IMG_QUALITY_HIGH);
send_to_intercom(IC_SET_IMG_SIZE, IMG_SIZE_L);
}
first_call = FALSE;
}
void restore_iso() {
send_to_intercom(IC_SET_ISO, EV_TRUNC(DPData.iso));
}
void restore_wb() {
if (DPData.wb == WB_MODE_COLORTEMP)
send_to_intercom(IC_SET_WB, WB_MODE_AUTO);
}
void restore_metering() {
if (DPData.metering == METERING_MODE_SPOT)
send_to_intercom(IC_SET_METERING, METERING_MODE_EVAL);
}