This source file includes following definitions.
- capt_seq_hook_raw_here
- wait_until_remote_button_is_released
- hook_raw_save_complete
- capt_seq_hook_set_nr
1
2 #include "asmsafe.h"
3 #include "conf.h"
4
5 #define RAWDATA_AVAILABLE (1)
6 #define RAWDATA_SAVED (2)
7
8
9
10 #ifndef NR_ON
11 #define NR_ON (2)
12 #endif
13 #ifndef NR_OFF
14 #define NR_OFF (1)
15 #endif
16
17 static long raw_save_stage;
18
19 #include "remotecap_core.h"
20
21 void __attribute__((naked,noinline)) capt_seq_hook_raw_here()
22 {
23 asm volatile("STMFD SP!, {R0-R12,LR}\n");
24
25 #ifdef PAUSE_FOR_FILE_COUNTER
26
27
28
29
30
31 if ((conf.save_raw && is_raw_enabled())
32 || (remotecap_get_target())
33 )
34 {
35 int fc = get_file_counter();
36 int tc = get_tick_count() + PAUSE_FOR_FILE_COUNTER;
37 while ((get_file_counter() == fc) && (get_tick_count() < tc)) {
38 _SleepTask(10);
39 }
40 }
41 #endif
42
43 raw_save_stage = RAWDATA_AVAILABLE;
44 core_rawdata_available();
45 while (raw_save_stage != RAWDATA_SAVED){
46 _SleepTask(10);
47 }
48 asm volatile("LDMFD SP!, {R0-R12,PC}\n");
49 }
50
51
52
53 void __attribute__((naked,noinline)) wait_until_remote_button_is_released( )
54 {
55 asm volatile (
56 ASM_SAFE("BL _wait_until_remote_button_is_released\n")
57 " BX LR \n"
58 ) ;
59 }
60
61
62 void hook_raw_save_complete()
63 {
64 raw_save_stage = RAWDATA_SAVED;
65 }
66
67 #if defined(USE_STUBS_NRFLAG)
68 extern long _nrflag;
69 #define set_nrflag(n) _nrflag = n
70 #else
71 #define set_nrflag(n) *nrflag = n
72 #endif
73
74 void __attribute__((naked,noinline)) capt_seq_hook_set_nr()
75 {
76 asm volatile("STMFD SP!, {R0-R12,LR}\n");
77 switch (conf.raw_nr){
78 case NOISE_REDUCTION_AUTO_CANON:
79
80 #if defined(NR_AUTO)
81 set_nrflag(NR_AUTO);
82 #endif
83 break;
84 case NOISE_REDUCTION_OFF:
85 set_nrflag(NR_OFF);
86 break;
87 case NOISE_REDUCTION_ON:
88 set_nrflag(NR_ON);
89 break;
90 };
91
92 camera_info.state.shutter_open_time = _time((void*)0);
93 camera_info.state.shutter_open_tick_count = get_tick_count();
94
95 asm volatile("LDMFD SP!, {R0-R12,PC}\n");
96 }
97