/firmware/src/Motherboard/EepromMap.cc

http://github.com/makerbot/G3Firmware · C++ · 35 lines · 12 code · 4 blank · 19 comment · 0 complexity · 0964e9ae6377689b7fd65fb75a8478d6 MD5 · raw file

  1. /*
  2. * Copyright 2010 by Adam Mayer <adam@makerbot.com>
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>
  16. */
  17. #include "EepromMap.hh"
  18. #include "Eeprom.hh"
  19. #include <avr/eeprom.h>
  20. namespace eeprom {
  21. // TODO: Shouldn't this just reset everything to an uninitialized state?
  22. void setDefaults() {
  23. // Initialize eeprom map
  24. // Default: enstops inverted, Y axis inverted
  25. uint8_t axis_invert = 1<<1; // Y axis = 1
  26. uint8_t endstop_invert = 0b00011111; // all endstops inverted
  27. eeprom_write_byte((uint8_t*)eeprom::AXIS_INVERSION,axis_invert);
  28. eeprom_write_byte((uint8_t*)eeprom::ENDSTOP_INVERSION,endstop_invert);
  29. eeprom_write_byte((uint8_t*)eeprom::MACHINE_NAME,0); // name is null
  30. }
  31. }