CHDK_DE Vorschauversion  Trunk Rev. 5836
 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 95 der Datei main.c.

96 {
98 }
void core_spytask ( )

Definiert in Zeile 115 der Datei main.c.

116 {
117  int cnt = 1;
118  int i=0;
119 #ifdef CAM_HAS_GPS
120  int gps_delay_timer = 200 ;
121  int gps_state = -1 ;
122 #endif
123 #if (OPT_DISABLE_CAM_ERROR)
124  extern void DisableCamError();
125  int dce_cnt=0;
126  int dce_prevmode=0;
127  int dce_nowmode;
128 #endif
129 
130  parse_version(&chdk_version, BUILD_NUMBER, BUILD_SVNREV);
131 
132  // Init camera_info bits that can't be done statically
134 
136 
137 #if !defined(CAM_DRYOS)
138 // create semaphore to protect Canon memory malloc/free/memPartInfo
139 // on VxWorks, spytask should start before any other CHDK tasks
140  extern void canon_malloc_init(void);
142 #endif
143 
144  extern void aram_malloc_init(void);
146 
147  extern void exmem_malloc_init(void);
149 
150 #ifdef CAM_CHDK_PTP
151  extern void init_chdk_ptp_task();
153 #endif
154 
155  while((i++<1000) && !spytask_can_start) msleep(10);
156 
157  started();
158  msleep(50);
159  finished();
160 
161 #if !CAM_DRYOS
162  drv_self_unhide();
163 #endif
164 
165  conf_restore();
166 
167  extern void gui_init();
168  gui_init();
169 
170 #if CAM_CONSOLE_LOG_ENABLED
171  extern void cam_console_init();
172  cam_console_init();
173 #endif
174 
175  static char *chdk_dirs[] =
176  {
177  "A/CHDK",
178  "A/CHDK/FONTS",
179  "A/CHDK/SYMBOLS",
180  "A/CHDK/SCRIPTS",
181  "A/CHDK/LANG",
182  "A/CHDK/BOOKS",
183  "A/CHDK/MODULES",
184  "A/CHDK/MODULES/CFG",
185  "A/CHDK/GRIDS",
186  "A/CHDK/CURVES",
187  "A/CHDK/DATA",
188  "A/CHDK/LOGS",
189  "A/CHDK/EDGE",
190  };
191  for (i = 0; i < (int)(sizeof(chdk_dirs) / sizeof(char*)); i++)
192  mkdir_if_not_exist(chdk_dirs[i]);
193 
194  no_modules_flag = stat("A/CHDK/MODULES/FSELECT.FLT",0) ? 1 : 0 ;
195 
196  // Calculate the value of get_tick_count() when the clock ticks over to the next second
197  // Used to calculate the SubSecondTime value when saving DNG files.
198  long t1, t2;
199  t2 = time(0);
200  do
201  {
202  t1 = t2;
204  t2 = time(0);
205  msleep(10);
206  } while (t1 != t2);
208 
209  // remote autostart
211  {
213  }
215  {
217  conf_save();
219  }
220 
221  shooting_init();
222 
223  // if starting with HDMI connected, suspend drawing for 3s to avoid crashes
224 #ifdef HDMI_HPD_FLAG
225  if(get_hdmi_hpd_physw_mod()) {
226  draw_suspend(3000);
227  }
228 #endif
229 
231  module_run("fwcrc.flt");
232  }
233 
234  while (1)
235  {
236  // Set up camera mode & state variables
237  mode_get();
238 
239 #ifdef CAM_CLEAN_OVERLAY
240  extern void handle_clean_overlay();
241  handle_clean_overlay();
242 #endif
243 
244 #ifdef CAM_UNLOCK_ANALOG_AV_IN_REC
245  extern void handle_analog_av_in_rec();
246  handle_analog_av_in_rec();
247 #endif
248  // update HDMI power override based on mode and remote settings
249 #ifdef CAM_REMOTE_HDMI_POWER_OVERRIDE
250  extern void update_hdmi_power_override(void);
251  update_hdmi_power_override();
252 #endif
253 
254  extern void set_palette();
255  set_palette();
256 
257 #if (OPT_DISABLE_CAM_ERROR)
258  dce_nowmode = camera_info.state.mode_play;
259  if (dce_prevmode==dce_nowmode)
260  { //no mode change
261  dce_cnt++; // overflow is not a concern here
262  }
263  else
264  { //mode has changed
265  dce_cnt=0;
266  }
267  if (dce_cnt==100)
268  { // 1..2s past play <-> rec mode change
269  DisableCamError();
270  }
271  dce_prevmode=dce_nowmode;
272 #endif
273 
274  if ( memdmptick && ((unsigned)get_tick_count() >= memdmptick) )
275  {
276  memdmptick = 0;
277  dump_memory();
278  }
279 
280 #ifdef CAM_HAS_GPS
281  if ( --gps_delay_timer == 0 )
282  {
283  gps_delay_timer = 50 ;
284  if ( gps_state != (int)conf.gps_on_off )
285  {
286  gps_state = (int)conf.gps_on_off ;
287  init_gps_startup(!gps_state) ;
288  }
289  }
290 #endif
291 
292  // Change ALT mode if the KBD task has flagged a state change
294 
295 #ifdef CAM_LOAD_CUSTOM_COLORS
296  // Color palette function
297  extern void load_chdk_palette();
299 #endif
300 
301  if (raw_data_available)
302  {
303  raw_process();
304  extern void hook_raw_save_complete();
306  raw_data_available = 0;
307 #ifdef CAM_HAS_GPS
308  if (((int)conf.gps_on_off == 1) && ((int)conf.gps_waypoint_save == 1)) gps_waypoint();
309 #endif
310 #if defined(CAM_CALC_BLACK_LEVEL)
311  // Reset to default in case used by non-RAW process code (e.g. raw merge)
313 #endif
314  continue;
315  }
316 
318  {
319 #ifdef CAM_DETECT_BITMAP_UPDATE
320  extern int check_gui_needs_redraw();
321  int gui_force_redraw = check_gui_needs_redraw();
322 #else
323  int gui_force_redraw = 0;
324 #endif
325  if (gui_force_redraw || (((cnt++) & 3) == 0))
326  gui_redraw(gui_force_redraw);
327  }
328 
330  {
331  if (conf.show_histo)
333 
335  {
336  // We need to skip first tick because stability
337  if (chdk_started_flag)
338  {
340  }
341  }
342  }
343 
345  {
347  }
348 
349  i = 0;
350 
351 #ifdef DEBUG_PRINT_TO_LCD
352  sprintf(osd_buf, "%d", cnt ); // modify cnt to what you want to display
354 #endif
355 #if defined(OPT_FILEIO_STATS)
356  sprintf(osd_buf, "%3d %3d %3d %3d %3d %3d %3d %4d",
357  camera_info.fileio_stats.fileio_semaphore_errors, camera_info.fileio_stats.close_badfile_count,
358  camera_info.fileio_stats.write_badfile_count, camera_info.fileio_stats.open_count,
359  camera_info.fileio_stats.close_count, camera_info.fileio_stats.open_fail_count,
360  camera_info.fileio_stats.close_fail_count, camera_info.fileio_stats.max_semaphore_timeout);
362 #endif
363 
365  {
366  sprintf(osd_buf, "MD last %-4d min %-4d max %-4d avg %-4d",
370  }
371 
372  // Process async module unload requests
374 
375  msleep(20);
377  }
378 }
void core_spytask_can_start ( )

Definiert in Zeile 100 der Datei main.c.

100  {
101  spytask_can_start = 1;
102 }
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  // update any state that needs to be updated regularly in shooting
126  extern void shooting_update_state(void);
128 
129  // Alternative keyboard mode stated/exited by pressing print key.
130  // While running Alt. mode shoot key will start a script execution.
131 
132  // alt-mode switch and delay emulation
133 
134  if ( key_pressed && !usb_remote_active )
135  {
137  || ((key_pressed >= CAM_EMUL_KEYPRESS_DELAY)
139  {
141  key_pressed++;
142  if (key_pressed == CAM_EMUL_KEYPRESS_DELAY)
144  else if (key_pressed == CAM_EMUL_KEYPRESS_DELAY+CAM_EMUL_KEYPRESS_DURATION)
146  return 1;
147  }
148  else if (kbd_get_pressed_key() == 0)
149  {
150  if (key_pressed < CAM_EMUL_KEYPRESS_DELAY)
151  {
152  if (!kbd_blocked)
153  {
154  // if start script on alt set, flag to run it
156  enter_alt(0);
157  }
158  else
159  exit_alt();
160  }
161  key_pressed = 0;
162  return 1;
163  }
164  return 1;
165  }
166 
167  // auto iso shift
169  return 0;
170 
172  {
173  key_pressed = 1;
175  return 1;
176  }
177 
178 #ifdef CAM_TOUCHSCREEN_UI
179  extern int ts_process_touch();
180  if (ts_process_touch())
181  {
183  }
184 #endif
185 
186  // deals with the rest
187 
188  if ( !kbd_blocked || usb_remote_active )
189  {
191  }
192 
193  if (gui_kbd_process())
194  return 1;
195 
197 
198  // Check if a PTP script needs to be started
199  // do this after action_stack_process_all so new script is not run until next timeslice
200  extern void start_ptp_script();
202 
203  return kbd_blocked;
204 }