Commit 20bec9b8 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

added driver disable flag (empty file named '/etc/elphel393/disable_driver')

parent 97b18b82
...@@ -261,6 +261,8 @@ $GLOBALS['configs'] = array(); ...@@ -261,6 +261,8 @@ $GLOBALS['configs'] = array();
$GLOBALS['init'] = false; $GLOBALS['init'] = false;
$GLOBALS['daemon'] = false; $GLOBALS['daemon'] = false;
$GLOBALS['driver_disabler'] = $GLOBALS['configDir']."/disable_driver";
log_open(); log_open();
...@@ -1415,11 +1417,19 @@ function get_application_mode() { ...@@ -1415,11 +1417,19 @@ function get_application_mode() {
if ($xml === false) { if ($xml === false) {
log_msg("10389 board not present"); log_msg("10389 board not present");
} else { } else {
log_msg ( 'Application - ' . (( string ) $xml->app) . ', mode: ' . (( string ) $xml->mode) . "\n" , 3);
// disable driver here
if (is_file($GLOBALS['driver_disabler'])){
$mode = 0;
}else{
$mode = intval($xml->mode);
}
log_msg ( 'Application - ' . (( string ) $xml->app) . ', mode: ' . (( string ) $mode) . "\n" , 3);
$GLOBALS ['camera_state_arr'] ['rev10389'] = ''.$xml->rev; $GLOBALS ['camera_state_arr'] ['rev10389'] = ''.$xml->rev;
if ((( string ) $xml->app) != '') { if ((( string ) $xml->app) != '') {
$GLOBALS ['camera_state_arr'] ['application'] = ''.$xml->app; $GLOBALS ['camera_state_arr'] ['application'] = ''.$xml->app;
$GLOBALS ['camera_state_arr'] ['mode'] = intval($xml->mode); $GLOBALS ['camera_state_arr'] ['mode'] = $mode;
} }
} }
write_php_ini ($GLOBALS['camera_state_arr'], $GLOBALS['camera_state_path'] ); write_php_ini ($GLOBALS['camera_state_arr'], $GLOBALS['camera_state_path'] );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment