CHDK_DE Vorschauversion  Trunk Rev. 5209
 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 #if !defined(CAM_DRYOS)
137 // create semaphore to protect Canon memory malloc/free/memPartInfo
138 // on VxWorks, spytask should start before any other CHDK tasks
139  extern void canon_malloc_init(void);
141 #endif
142 
143  extern void aram_malloc_init(void);
145 
146  extern void exmem_malloc_init(void);
148 
149 #ifdef CAM_CHDK_PTP
150  extern void init_chdk_ptp_task();
152 #endif
153 
154  while((i++<1000) && !spytask_can_start) msleep(10);
155 
156  started();
157  msleep(50);
158  finished();
159 
160 #if !CAM_DRYOS
161  drv_self_unhide();
162 #endif
163 
164  conf_restore();
165 
166  extern void gui_init();
167  gui_init();
168 
169 #if CAM_CONSOLE_LOG_ENABLED
170  extern void cam_console_init();
171  cam_console_init();
172 #endif
173 
174  static char *chdk_dirs[] =
175  {
176  "A/CHDK",
177  "A/CHDK/FONTS",
178  "A/CHDK/SYMBOLS",
179  "A/CHDK/SCRIPTS",
180  "A/CHDK/LANG",
181  "A/CHDK/BOOKS",
182  "A/CHDK/MODULES",
183  "A/CHDK/MODULES/CFG",
184  "A/CHDK/GRIDS",
185  "A/CHDK/CURVES",
186  "A/CHDK/DATA",
187  "A/CHDK/LOGS",
188  "A/CHDK/EDGE",
189  };
190  for (i = 0; i < sizeof(chdk_dirs) / sizeof(char*); i++)
191  mkdir_if_not_exist(chdk_dirs[i]);
192 
193  no_modules_flag = stat("A/CHDK/MODULES/FSELECT.FLT",0) ? 1 : 0 ;
194 
195  // Calculate the value of get_tick_count() when the clock ticks over to the next second
196  // Used to calculate the SubSecondTime value when saving DNG files.
197  long t1, t2;
198  t2 = time(0);
199  do
200  {
201  t1 = t2;
203  t2 = time(0);
204  msleep(10);
205  } while (t1 != t2);
207 
208  // remote autostart
210  {
212  }
214  {
216  conf_save();
218  }
219 
220  shooting_init();
221 
222  while (1)
223  {
224  // Set up camera mode & state variables
225  mode_get();
226  // update HDMI power override based on mode and remote settings
227 #ifdef CAM_REMOTE_HDMI_POWER_OVERRIDE
228  extern void update_hdmi_power_override(void);
229  update_hdmi_power_override();
230 #endif
231 
232  extern void set_palette();
233  set_palette();
234 
235 #if (OPT_DISABLE_CAM_ERROR)
236  dce_nowmode = camera_info.state.mode_play;
237  if (dce_prevmode==dce_nowmode)
238  { //no mode change
239  dce_cnt++; // overflow is not a concern here
240  }
241  else
242  { //mode has changed
243  dce_cnt=0;
244  }
245  if (dce_cnt==100)
246  { // 1..2s past play <-> rec mode change
247  DisableCamError();
248  }
249  dce_prevmode=dce_nowmode;
250 #endif
251 
252  if ( memdmptick && (get_tick_count() >= memdmptick) )
253  {
254  memdmptick = 0;
255  dump_memory();
256  }
257 
258 #ifdef CAM_HAS_GPS
259  if ( --gps_delay_timer == 0 )
260  {
261  gps_delay_timer = 50 ;
262  if ( gps_state != (int)conf.gps_on_off )
263  {
264  gps_state = (int)conf.gps_on_off ;
265  init_gps_startup(!gps_state) ;
266  }
267  }
268 #endif
269 
270  // Change ALT mode if the KBD task has flagged a state change
272 
273 #ifdef CAM_LOAD_CUSTOM_COLORS
274  // Color palette function
275  extern void load_chdk_palette();
277 #endif
278 
279  if (raw_data_available)
280  {
281  raw_process();
282  extern void hook_raw_save_complete();
284  raw_data_available = 0;
285 #ifdef CAM_HAS_GPS
286  if (((int)conf.gps_on_off == 1) && ((int)conf.gps_waypoint_save == 1)) gps_waypoint();
287 #endif
288 #if defined(CAM_CALC_BLACK_LEVEL)
289  // Reset to default in case used by non-RAW process code (e.g. raw merge)
291 #endif
292  continue;
293  }
294 
296  {
297  if (((cnt++) & 3) == 0)
298  gui_redraw();
299  }
300 
302  {
303  if (conf.show_histo)
305 
307  {
308  // We need to skip first tick because stability
309  if (chdk_started_flag)
310  {
312  }
313  }
314  }
315 
317  {
319  }
320 
321  i = 0;
322 
323 #ifdef DEBUG_PRINT_TO_LCD
324  sprintf(osd_buf, "%d", cnt ); // modify cnt to what you want to display
326 #endif
327 #if defined(OPT_FILEIO_STATS)
328  sprintf(osd_buf, "%3d %3d %3d %3d %3d %3d %3d %4d",
329  camera_info.fileio_stats.fileio_semaphore_errors, camera_info.fileio_stats.close_badfile_count,
330  camera_info.fileio_stats.write_badfile_count, camera_info.fileio_stats.open_count,
331  camera_info.fileio_stats.close_count, camera_info.fileio_stats.open_fail_count,
332  camera_info.fileio_stats.close_fail_count, camera_info.fileio_stats.max_semaphore_timeout);
334 #endif
335 
337  {
338  sprintf(osd_buf, "MD last %-4d min %-4d max %-4d avg %-4d",
342  }
343 
344  // Process async module unload requests
346 
347  msleep(20);
349  }
350 }
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 }