コード例 #1
0
/**
 *	\fn int Inicializar(void)
 *	\brief Resumen
 *	\details Detalles
 *	\author Bustamante, Capuj, Romero, Pizzani
 *	\date 06-11-2015 09:48:39
 */
int Inicializar_Sys(void)
{

	settings_restore_global_settings();
	init_system_var();
	//uint8_t c;
	/*
	 * reset estructuras y buffers, planner, stepper, serial,
	 * cargar deafult settigs ( sin home )
	 *
	 * establecer conexion con la pc, si falla ir a Alarm (mensaje en lcd)
	 * conexion ok, mensaje de bienvenida ( lcd, entorno ..)
	 *
	 *
	 * go idle
	 */
//	sendSerialString(PC_CONNECTION); //ver si hace falta meter un delay
//	c = serialRead();
//	if(c!=CONNECTION_ESTABLISHED)
//		sys.alarm = NO_PC_CONNECTION;
//	else
//	{

//	}
	return TRUE;
}
コード例 #2
0
ファイル: settings.c プロジェクト: 100takis/grbl
// Initialize the config subsystem
void settings_init() {
  if(!read_global_settings()) {
    report_status_message(STATUS_SETTING_READ_FAIL);

    settings_restore_global_settings();
    
    // Force clear startup lines and build info user data. Parameters should be ok.
    // TODO: For next version, remove these clears. Only here because line buffer increased.
    settings_clear_startup_lines();
    settings_clear_build_info();
    
    report_grbl_settings();
  }

  // Check all parameter data into a dummy variable. If error, reset to zero, otherwise do nothing.
  float coord_data[N_AXIS];
  uint8_t i;
  for (i=0; i<=SETTING_INDEX_NCOORD; i++) {
    if (!settings_read_coord_data(i, coord_data)) {
      report_status_message(STATUS_SETTING_READ_FAIL);
    }
  }
  // NOTE: Startup lines are checked and executed by protocol_main_loop at the end of initialization.
  // TODO: Build info should be checked here, but will wait until v1.0 to address this. Ok for now.
}