get_application_mode();// initializes state file (first time slow reading 10389
get_application_mode();// initializes state file, sets $GLOBALS['init'] and $GLOBALS['camera_state_arr']['state']=='REBOOT' from both command line and $_GET
// === First initialization step that does not need parameter values - programming power, FPGA, detecting connected sensors (will reboot if requested) ===
log_msg("Detecting sensors for ".$GLOBALS['camera_state_arr']['application']);
reset_camera();// will try to prepare camera for reinitialization, ask to reset+exit if not possible, or just do nothing if initialization is not finished
detect_camera();// will reboot if requested
}else{
respond_xml('','Should never get here');
}
detect_mt9p006();
}
// Todo: Add a single camera with 10359?
//log_msg("Sensors map read from the sysfs:\n".str_sensors($GLOBALS['sensors']),1);
//$GLOBALS ['sensor_port']
///+++++++++++++++++++++++++++++++++++++++++++++
// === Handle parameters configuration files ===
// Create new configs if they do not exist (after sensor ports are detected)
// === Launch processing of HTTP GET and POST requests (and exit after), continue only for command-line mode (--init or --daemon) and HTTP with 'init' ===