Esempio n. 1
0
// 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.
}
Esempio n. 2
0
// Initialize the config subsystem
void settings_init() {
  if(!read_global_settings()) {
    report_status_message(STATUS_SETTING_READ_FAIL);
    settings_restore(SETTINGS_RESTORE_ALL); // Force restore all EEPROM data.
    report_grbl_settings();
  }
}
Esempio n. 3
0
// Initialize the config subsystem
void settings_init() {
  if(!read_global_settings()) {
    report_status_message(STATUS_SETTING_READ_FAIL);
    settings_reset();
    report_grbl_settings();
  }
  // Read 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 handled and called by main.c at the end of initialization.
}
Esempio n. 4
0
// Initialize the config subsystem
void settings_init() {
  if(!read_global_settings()) {
    report_status_message(STATUS_SETTING_READ_FAIL);
    settings_restore(SETTINGS_RESTORE_ALL); // Force restore all EEPROM data.
    report_grbl_settings();
  }

  // NOTE: Checking paramater data, startup lines, and build info string should be done here, 
  // but it seems fairly redundant. Each of these can be manually checked and reset or restored.
  // 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.
}