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

97 {
99 }
void core_spytask ( )

Definiert in Zeile 116 der Datei main.c.

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

Definiert in Zeile 101 der Datei main.c.

101  {
102  spytask_can_start = 1;
103 }
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();
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 }