CHDK_DE Vorschauversion  Trunk Rev. 5163
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
core.h-Dateireferenz
+ Dieser Graph zeigt, welche Datei direkt oder indirekt diese Datei enthält:

gehe zum Quellcode dieser Datei

Makrodefinitionen

#define NOISE_REDUCTION_AUTO_CANON   (0)
 
#define NOISE_REDUCTION_OFF   (1)
 
#define NOISE_REDUCTION_ON   (2)
 

Funktionen

long kbd_process ()
 
void core_spytask ()
 
void core_spytask_can_start ()
 
void core_rawdata_available ()
 

Makro-Dokumentation

#define NOISE_REDUCTION_AUTO_CANON   (0)

Definiert in Zeile 11 der Datei core.h.

#define NOISE_REDUCTION_OFF   (1)

Definiert in Zeile 12 der Datei core.h.

#define NOISE_REDUCTION_ON   (2)

Definiert in Zeile 13 der Datei core.h.

Dokumentation der Funktionen

void core_rawdata_available ( )

Definiert in Zeile 94 der Datei main.c.

95 {
97 }
void core_spytask ( )

Definiert in Zeile 114 der Datei main.c.

115 {
116  int cnt = 1;
117  int i=0;
118 #ifdef CAM_HAS_GPS
119  int gps_delay_timer = 200 ;
120  int gps_state = -1 ;
121 #endif
122 #if (OPT_DISABLE_CAM_ERROR)
123  extern void DisableCamError();
124  int dce_cnt=0;
125  int dce_prevmode=0;
126  int dce_nowmode;
127 #endif
128 
129  parse_version(&chdk_version, BUILD_NUMBER, BUILD_SVNREV);
130 
131  // Init camera_info bits that can't be done statically
133 
135 
136  extern void aram_malloc_init(void);
138 
139  extern void exmem_malloc_init(void);
141 
142 #ifdef CAM_CHDK_PTP
143  extern void init_chdk_ptp_task();
145 #endif
146 
147  while((i++<400) && !spytask_can_start) msleep(10);
148 
149  started();
150  msleep(50);
151  finished();
152 
153 #if !CAM_DRYOS
154  drv_self_unhide();
155 #endif
156 
157  conf_restore();
158 
159  extern void gui_init();
160  gui_init();
161 
162 #if CAM_CONSOLE_LOG_ENABLED
163  extern void cam_console_init();
164  cam_console_init();
165 #endif
166 
167  static char *chdk_dirs[] =
168  {
169  "A/CHDK",
170  "A/CHDK/FONTS",
171  "A/CHDK/SYMBOLS",
172  "A/CHDK/SCRIPTS",
173  "A/CHDK/LANG",
174  "A/CHDK/BOOKS",
175  "A/CHDK/MODULES",
176  "A/CHDK/MODULES/CFG",
177  "A/CHDK/GRIDS",
178  "A/CHDK/CURVES",
179  "A/CHDK/DATA",
180  "A/CHDK/LOGS",
181  "A/CHDK/EDGE",
182  };
183  for (i = 0; i < sizeof(chdk_dirs) / sizeof(char*); i++)
184  mkdir_if_not_exist(chdk_dirs[i]);
185 
186  no_modules_flag = stat("A/CHDK/MODULES/FSELECT.FLT",0) ? 1 : 0 ;
187 
188  // Calculate the value of get_tick_count() when the clock ticks over to the next second
189  // Used to calculate the SubSecondTime value when saving DNG files.
190  long t1, t2;
191  t2 = time(0);
192  do
193  {
194  t1 = t2;
196  t2 = time(0);
197  msleep(10);
198  } while (t1 != t2);
200 
201  // remote autostart
203  {
205  }
207  {
209  conf_save();
211  }
212 
213  shooting_init();
214 
215  while (1)
216  {
217  // Set up camera mode & state variables
218  mode_get();
219  // update HDMI power override based on mode and remote settings
220 #ifdef CAM_REMOTE_HDMI_POWER_OVERRIDE
221  extern void update_hdmi_power_override(void);
222  update_hdmi_power_override();
223 #endif
224 
225  extern void set_palette();
226  set_palette();
227 
228 #if (OPT_DISABLE_CAM_ERROR)
229  dce_nowmode = camera_info.state.mode_play;
230  if (dce_prevmode==dce_nowmode)
231  { //no mode change
232  dce_cnt++; // overflow is not a concern here
233  }
234  else
235  { //mode has changed
236  dce_cnt=0;
237  }
238  if (dce_cnt==100)
239  { // 1..2s past play <-> rec mode change
240  DisableCamError();
241  }
242  dce_prevmode=dce_nowmode;
243 #endif
244 
245  if ( memdmptick && (get_tick_count() >= memdmptick) )
246  {
247  memdmptick = 0;
248  dump_memory();
249  }
250 
251 #ifdef CAM_HAS_GPS
252  if ( --gps_delay_timer == 0 )
253  {
254  gps_delay_timer = 50 ;
255  if ( gps_state != (int)conf.gps_on_off )
256  {
257  gps_state = (int)conf.gps_on_off ;
258  init_gps_startup(!gps_state) ;
259  }
260  }
261 #endif
262 
263  // Change ALT mode if the KBD task has flagged a state change
265 
266 #ifdef CAM_LOAD_CUSTOM_COLORS
267  // Color palette function
268  extern void load_chdk_palette();
270 #endif
271 
272  if (raw_data_available)
273  {
274  raw_process();
275  extern void hook_raw_save_complete();
277  raw_data_available = 0;
278 #ifdef CAM_HAS_GPS
279  if (((int)conf.gps_on_off == 1) && ((int)conf.gps_waypoint_save == 1)) gps_waypoint();
280 #endif
281 #if defined(CAM_CALC_BLACK_LEVEL)
282  // Reset to default in case used by non-RAW process code (e.g. raw merge)
284 #endif
285  continue;
286  }
287 
289  {
290  if (((cnt++) & 3) == 0)
291  gui_redraw();
292  }
293 
295  {
296  if (conf.show_histo)
298 
300  {
301  // We need to skip first tick because stability
302  if (chdk_started_flag)
303  {
305  }
306  }
307  }
308 
310  {
312  }
313 
314  i = 0;
315 
316 #ifdef DEBUG_PRINT_TO_LCD
317  sprintf(osd_buf, "%d", cnt ); // modify cnt to what you want to display
319 #endif
320 #if defined(OPT_FILEIO_STATS)
321  sprintf(osd_buf, "%3d %3d %3d %3d %3d %3d %3d %4d",
322  camera_info.fileio_stats.fileio_semaphore_errors, camera_info.fileio_stats.close_badfile_count,
323  camera_info.fileio_stats.write_badfile_count, camera_info.fileio_stats.open_count,
324  camera_info.fileio_stats.close_count, camera_info.fileio_stats.open_fail_count,
325  camera_info.fileio_stats.close_fail_count, camera_info.fileio_stats.max_semaphore_timeout);
327 #endif
328 
330  {
331  sprintf(osd_buf, "MD last %-4d min %-4d max %-4d avg %-4d",
335  }
336 
337  // Process async module unload requests
339 
340  msleep(20);
342  }
343 }
void core_spytask_can_start ( )

Definiert in Zeile 99 der Datei main.c.

99  {
100  spytask_can_start = 1;
101 }
long kbd_process ( )

Definiert in Zeile 81 der Datei kbd_process.c.

82 {
83  static int key_pressed;
84 
86 
88  {
90  {
91  case 1:
93  {
96  }
97  break;
98  case 2:
100  {
103  }
104  break;
105  }
106  }
107 
108  // check for & process non-keyboard script terminate
110 
111  // Reset keyboard auto repeat if no buttons pressed
112  if (kbd_get_pressed_key() == 0)
113  last_kbd_key = 0;
114 
115  // Set clicked key for scripts.
116  if (kbd_get_clicked_key())
117  {
120  }
121 
122  // Set Shutter Half Press state for GUI task.
124 
125  // Alternative keyboard mode stated/exited by pressing print key.
126  // While running Alt. mode shoot key will start a script execution.
127 
128  // alt-mode switch and delay emulation
129 
130  if ( key_pressed && !usb_remote_active )
131  {
133  || ((key_pressed >= CAM_EMUL_KEYPRESS_DELAY)
135  {
137  key_pressed++;
138  if (key_pressed == CAM_EMUL_KEYPRESS_DELAY)
140  else if (key_pressed == CAM_EMUL_KEYPRESS_DELAY+CAM_EMUL_KEYPRESS_DURATION)
142  return 1;
143  }
144  else if (kbd_get_pressed_key() == 0)
145  {
146  if (key_pressed < CAM_EMUL_KEYPRESS_DELAY)
147  {
148  if (!kbd_blocked)
149  {
150  // if start script on alt set, flag to run it
152  enter_alt();
153  }
154  else
155  exit_alt();
156  }
157  key_pressed = 0;
158  return 1;
159  }
160  return 1;
161  }
162 
163  // auto iso shift
165  return 0;
166 
168  {
169  key_pressed = 1;
171  return 1;
172  }
173 
174 #ifdef CAM_TOUCHSCREEN_UI
175  extern int ts_process_touch();
176  if (ts_process_touch())
177  {
179  }
180 #endif
181 
182  // deals with the rest
183 
184  if ( !kbd_blocked || usb_remote_active )
185  {
187  }
188 
189  if (gui_kbd_process())
190  return 1;
191 
193 
194  // Check if a PTP script needs to be started
195  // do this after action_stack_process_all so new script is not run until next timeslice
196  extern void start_ptp_script();
198 
199  return kbd_blocked;
200 }