diff --git a/Images/IMG_20150325_220904.jpg b/Images/IMG_20150325_220904.jpg
new file mode 100644
index 000000000..8e945ed17
Binary files /dev/null and b/Images/IMG_20150325_220904.jpg differ
diff --git a/Images/IMG_20150325_220919.jpg b/Images/IMG_20150325_220919.jpg
new file mode 100644
index 000000000..498e7cb66
Binary files /dev/null and b/Images/IMG_20150325_220919.jpg differ
diff --git a/Images/IMG_20150325_223348.jpg b/Images/IMG_20150325_223348.jpg
new file mode 100644
index 000000000..d04221e2b
Binary files /dev/null and b/Images/IMG_20150325_223348.jpg differ
diff --git a/Images/IMG_20150325_223515.jpg b/Images/IMG_20150325_223515.jpg
new file mode 100644
index 000000000..64cfccaa4
Binary files /dev/null and b/Images/IMG_20150325_223515.jpg differ
diff --git a/Marlin/Marlin.ino b/Marlin/Marlin.ino
new file mode 100644
index 000000000..d3f5a12fa
--- /dev/null
+++ b/Marlin/Marlin.ino
@@ -0,0 +1 @@
+
diff --git a/config.h b/Marlin/config.h
similarity index 98%
rename from config.h
rename to Marlin/config.h
index 6fa9e88f6..509eef129 100644
--- a/config.h
+++ b/Marlin/config.h
@@ -1,272 +1,272 @@
-/*
- config.h - compile time configuration
- Part of Horus Firmware
-
- Copyright (c) 2014-2015 Mundo Reader S.L.
-
- Horus Firmware is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Horus Firmware is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Horus Firmware. If not, see .
-*/
-/*
- This file is based on work from Grbl v0.9, distributed under the
- terms of the GPLv3. See COPYING for more details.
- Copyright (c) 2009-2011 Simen Svale Skogsrud
- Copyright (c) 2011-2014 Sungeun K. Jeon
-*/
-
-// This file contains compile-time configurations for Grbl's internal system. For the most part,
-// users will not need to directly modify these, but they are here for specific needs, i.e.
-// performance tuning or adjusting to non-typical machines.
-
-// IMPORTANT: Any changes here requires a full re-compiling of the source code to propagate them.
-
-#ifndef config_h
-#define config_h
-#include "system.h"
-
-
-// Default settings. Used when resetting EEPROM. Change to desired name in defaults.h
-#define DEFAULTS_HORUS
-
-// Serial baud rate
-#define BAUD_RATE 115200
-
-// Default cpu mappings. Grbl officially supports the Arduino Uno only. Other processor types
-// may exist from user-supplied templates or directly user-defined in cpu_map.h
-#define CPU_MAP_ATMEGA328P_HORUS // Arduino Uno CPU for Horus Project
-
-// Define runtime command special characters. These characters are 'picked-off' directly from the
-// serial read data stream and are not passed to the grbl line execution parser. Select characters
-// that do not and must not exist in the streamed g-code program. ASCII control characters may be
-// used, if they are available per user setup. Also, extended ASCII codes (>127), which are never in
-// g-code programs, maybe selected for interface programs.
-// NOTE: If changed, manually update help message in report.c.
-#define CMD_STATUS_REPORT '?'
-#define CMD_FEED_HOLD '!'
-#define CMD_CYCLE_START '~'
-#define CMD_RESET 0x18 // ctrl-x.
-
-// If homing is enabled, homing init lock sets Grbl into an alarm state upon power up. This forces
-// the user to perform the homing cycle (or override the locks) before doing anything else. This is
-// mainly a safety feature to remind the user to home, since position is unknown to Grbl.
-#define HOMING_INIT_LOCK // Comment to disable
-
-// Define the homing cycle patterns with bitmasks. The homing cycle first performs a search mode
-// to quickly engage the limit switches, followed by a slower locate mode, and finished by a short
-// pull-off motion to disengage the limit switches. The following HOMING_CYCLE_x defines are executed
-// in order starting with suffix 0 and completes the homing routine for the specified-axes only. If
-// an axis is omitted from the defines, it will not home, nor will the system update its position.
-// Meaning that this allows for users with non-standard cartesian machines, such as a lathe (x then z,
-// with no y), to configure the homing cycle behavior to their needs.
-// NOTE: The homing cycle is designed to allow sharing of limit pins, if the axes are not in the same
-// cycle, but this requires some pin settings changes in cpu_map.h file. For example, the default homing
-// cycle can share the Z limit pin with either X or Y limit pins, since they are on different cycles.
-// By sharing a pin, this frees up a precious IO pin for other purposes. In theory, all axes limit pins
-// may be reduced to one pin, if all axes are homed with seperate cycles, or vice versa, all three axes
-// on separate pin, but homed in one cycle. Also, it should be noted that the function of hard limits
-// will not be affected by pin sharing.
-// NOTE: Defaults are set for a traditional 3-axis CNC machine. Z-axis first to clear, followed by X & Y.
-#define HOMING_CYCLE_0 (1< 3us, and, when added with the
-// user-supplied step pulse time, the total time must not exceed 127us. Reported successful
-// values for certain setups have ranged from 5 to 20us.
-// #define STEP_PULSE_DELAY 10 // Step pulse delay in microseconds. Default disabled.
-
-// The number of linear motions in the planner buffer to be planned at any give time. The vast
-// majority of RAM that Grbl uses is based on this buffer size. Only increase if there is extra
-// available RAM, like when re-compiling for a Mega or Sanguino. Or decrease if the Arduino
-// begins to crash due to the lack of available RAM or if the CPU is having trouble keeping
-// up with planning new incoming motions as they are executed.
-// #define BLOCK_BUFFER_SIZE 18 // Uncomment to override default in planner.h.
-
-// Governs the size of the intermediary step segment buffer between the step execution algorithm
-// and the planner blocks. Each segment is set of steps executed at a constant velocity over a
-// fixed time defined by ACCELERATION_TICKS_PER_SECOND. They are computed such that the planner
-// block velocity profile is traced exactly. The size of this buffer governs how much step
-// execution lead time there is for other Grbl processes have to compute and do their thing
-// before having to come back and refill this buffer, currently at ~50msec of step moves.
-// #define SEGMENT_BUFFER_SIZE 6 // Uncomment to override default in stepper.h.
-
-// Line buffer size from the serial input stream to be executed. Also, governs the size of
-// each of the startup blocks, as they are each stored as a string of this size. Make sure
-// to account for the available EEPROM at the defined memory address in settings.h and for
-// the number of desired startup blocks.
-// NOTE: 80 characters is not a problem except for extreme cases, but the line buffer size
-// can be too small and g-code blocks can get truncated. Officially, the g-code standards
-// support up to 256 characters. In future versions, this default will be increased, when
-// we know how much extra memory space we can re-invest into this.
-// #define LINE_BUFFER_SIZE 80 // Uncomment to override default in protocol.h
-
-// Serial send and receive buffer size. The receive buffer is often used as another streaming
-// buffer to store incoming blocks to be processed by Grbl when its ready. Most streaming
-// interfaces will character count and track each block send to each block response. So,
-// increase the receive buffer if a deeper receive buffer is needed for streaming and avaiable
-// memory allows. The send buffer primarily handles messages in Grbl. Only increase if large
-// messages are sent and Grbl begins to stall, waiting to send the rest of the message.
-// NOTE: Buffer size values must be greater than zero and less than 256.
-// #define RX_BUFFER_SIZE 128 // Uncomment to override defaults in serial.h
-// #define TX_BUFFER_SIZE 64
-
-// Toggles XON/XOFF software flow control for serial communications. Not officially supported
-// due to problems involving the Atmega8U2 USB-to-serial chips on current Arduinos. The firmware
-// on these chips do not support XON/XOFF flow control characters and the intermediate buffer
-// in the chips cause latency and overflow problems with standard terminal programs. However,
-// using specifically-programmed UI's to manage this latency problem has been confirmed to work.
-// As well as, older FTDI FT232RL-based Arduinos(Duemilanove) are known to work with standard
-// terminal programs since their firmware correctly manage these XON/XOFF characters. In any
-// case, please report any successes to grbl administrators!
-// #define ENABLE_XONXOFF // Default disabled. Uncomment to enable.
-
-// A simple software debouncing feature for hard limit switches. When enabled, the interrupt
-// monitoring the hard limit switch pins will enable the Arduino's watchdog timer to re-check
-// the limit pin state after a delay of about 32msec. This can help with CNC machines with
-// problematic false triggering of their hard limit switches, but it WILL NOT fix issues with
-// electrical interference on the signal cables from external sources. It's recommended to first
-// use shielded signal cables with their shielding connected to ground (old USB/computer cables
-// work well and are cheap to find) and wire in a low-pass circuit into each limit pin.
-// #define ENABLE_SOFTWARE_DEBOUNCE // Default disabled. Uncomment to enable.
-
-// ---------------------------------------------------------------------------------------
-
-// TODO: Install compile-time option to send numeric status codes rather than strings.
-
-// ---------------------------------------------------------------------------------------
-// COMPILE-TIME ERROR CHECKING OF DEFINE VALUES:
-
-// #if (ISR_TICKS_PER_ACCELERATION_TICK > 255)
-// #error Parameters ACCELERATION_TICKS / ISR_TICKS must be < 256 to prevent integer overflow.
-// #endif
-
-// ---------------------------------------------------------------------------------------
-
-
-#endif
+/*
+ config.h - compile time configuration
+ Part of Horus Firmware
+
+ Copyright (c) 2014-2015 Mundo Reader S.L.
+
+ Horus Firmware is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Horus Firmware is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Horus Firmware. If not, see .
+*/
+/*
+ This file is based on work from Grbl v0.9, distributed under the
+ terms of the GPLv3. See COPYING for more details.
+ Copyright (c) 2009-2011 Simen Svale Skogsrud
+ Copyright (c) 2011-2014 Sungeun K. Jeon
+*/
+
+// This file contains compile-time configurations for Grbl's internal system. For the most part,
+// users will not need to directly modify these, but they are here for specific needs, i.e.
+// performance tuning or adjusting to non-typical machines.
+
+// IMPORTANT: Any changes here requires a full re-compiling of the source code to propagate them.
+
+#ifndef config_h
+#define config_h
+#include "system.h"
+
+
+// Default settings. Used when resetting EEPROM. Change to desired name in defaults.h
+#define DEFAULTS_HORUS
+
+// Serial baud rate
+#define BAUD_RATE 115200
+
+// Default cpu mappings. Grbl officially supports the Arduino Uno only. Other processor types
+// may exist from user-supplied templates or directly user-defined in cpu_map.h
+#define CPU_MAP_ATMEGA328P_CNCV3 // Arduino Uno CPU for Horus Project
+
+// Define runtime command special characters. These characters are 'picked-off' directly from the
+// serial read data stream and are not passed to the grbl line execution parser. Select characters
+// that do not and must not exist in the streamed g-code program. ASCII control characters may be
+// used, if they are available per user setup. Also, extended ASCII codes (>127), which are never in
+// g-code programs, maybe selected for interface programs.
+// NOTE: If changed, manually update help message in report.c.
+#define CMD_STATUS_REPORT '?'
+#define CMD_FEED_HOLD '!'
+#define CMD_CYCLE_START '~'
+#define CMD_RESET 0x18 // ctrl-x.
+
+// If homing is enabled, homing init lock sets Grbl into an alarm state upon power up. This forces
+// the user to perform the homing cycle (or override the locks) before doing anything else. This is
+// mainly a safety feature to remind the user to home, since position is unknown to Grbl.
+#define HOMING_INIT_LOCK // Comment to disable
+
+// Define the homing cycle patterns with bitmasks. The homing cycle first performs a search mode
+// to quickly engage the limit switches, followed by a slower locate mode, and finished by a short
+// pull-off motion to disengage the limit switches. The following HOMING_CYCLE_x defines are executed
+// in order starting with suffix 0 and completes the homing routine for the specified-axes only. If
+// an axis is omitted from the defines, it will not home, nor will the system update its position.
+// Meaning that this allows for users with non-standard cartesian machines, such as a lathe (x then z,
+// with no y), to configure the homing cycle behavior to their needs.
+// NOTE: The homing cycle is designed to allow sharing of limit pins, if the axes are not in the same
+// cycle, but this requires some pin settings changes in cpu_map.h file. For example, the default homing
+// cycle can share the Z limit pin with either X or Y limit pins, since they are on different cycles.
+// By sharing a pin, this frees up a precious IO pin for other purposes. In theory, all axes limit pins
+// may be reduced to one pin, if all axes are homed with seperate cycles, or vice versa, all three axes
+// on separate pin, but homed in one cycle. Also, it should be noted that the function of hard limits
+// will not be affected by pin sharing.
+// NOTE: Defaults are set for a traditional 3-axis CNC machine. Z-axis first to clear, followed by X & Y.
+#define HOMING_CYCLE_0 (1< 3us, and, when added with the
+// user-supplied step pulse time, the total time must not exceed 127us. Reported successful
+// values for certain setups have ranged from 5 to 20us.
+// #define STEP_PULSE_DELAY 10 // Step pulse delay in microseconds. Default disabled.
+
+// The number of linear motions in the planner buffer to be planned at any give time. The vast
+// majority of RAM that Grbl uses is based on this buffer size. Only increase if there is extra
+// available RAM, like when re-compiling for a Mega or Sanguino. Or decrease if the Arduino
+// begins to crash due to the lack of available RAM or if the CPU is having trouble keeping
+// up with planning new incoming motions as they are executed.
+// #define BLOCK_BUFFER_SIZE 18 // Uncomment to override default in planner.h.
+
+// Governs the size of the intermediary step segment buffer between the step execution algorithm
+// and the planner blocks. Each segment is set of steps executed at a constant velocity over a
+// fixed time defined by ACCELERATION_TICKS_PER_SECOND. They are computed such that the planner
+// block velocity profile is traced exactly. The size of this buffer governs how much step
+// execution lead time there is for other Grbl processes have to compute and do their thing
+// before having to come back and refill this buffer, currently at ~50msec of step moves.
+// #define SEGMENT_BUFFER_SIZE 6 // Uncomment to override default in stepper.h.
+
+// Line buffer size from the serial input stream to be executed. Also, governs the size of
+// each of the startup blocks, as they are each stored as a string of this size. Make sure
+// to account for the available EEPROM at the defined memory address in settings.h and for
+// the number of desired startup blocks.
+// NOTE: 80 characters is not a problem except for extreme cases, but the line buffer size
+// can be too small and g-code blocks can get truncated. Officially, the g-code standards
+// support up to 256 characters. In future versions, this default will be increased, when
+// we know how much extra memory space we can re-invest into this.
+// #define LINE_BUFFER_SIZE 80 // Uncomment to override default in protocol.h
+
+// Serial send and receive buffer size. The receive buffer is often used as another streaming
+// buffer to store incoming blocks to be processed by Grbl when its ready. Most streaming
+// interfaces will character count and track each block send to each block response. So,
+// increase the receive buffer if a deeper receive buffer is needed for streaming and avaiable
+// memory allows. The send buffer primarily handles messages in Grbl. Only increase if large
+// messages are sent and Grbl begins to stall, waiting to send the rest of the message.
+// NOTE: Buffer size values must be greater than zero and less than 256.
+// #define RX_BUFFER_SIZE 128 // Uncomment to override defaults in serial.h
+// #define TX_BUFFER_SIZE 64
+
+// Toggles XON/XOFF software flow control for serial communications. Not officially supported
+// due to problems involving the Atmega8U2 USB-to-serial chips on current Arduinos. The firmware
+// on these chips do not support XON/XOFF flow control characters and the intermediate buffer
+// in the chips cause latency and overflow problems with standard terminal programs. However,
+// using specifically-programmed UI's to manage this latency problem has been confirmed to work.
+// As well as, older FTDI FT232RL-based Arduinos(Duemilanove) are known to work with standard
+// terminal programs since their firmware correctly manage these XON/XOFF characters. In any
+// case, please report any successes to grbl administrators!
+// #define ENABLE_XONXOFF // Default disabled. Uncomment to enable.
+
+// A simple software debouncing feature for hard limit switches. When enabled, the interrupt
+// monitoring the hard limit switch pins will enable the Arduino's watchdog timer to re-check
+// the limit pin state after a delay of about 32msec. This can help with CNC machines with
+// problematic false triggering of their hard limit switches, but it WILL NOT fix issues with
+// electrical interference on the signal cables from external sources. It's recommended to first
+// use shielded signal cables with their shielding connected to ground (old USB/computer cables
+// work well and are cheap to find) and wire in a low-pass circuit into each limit pin.
+// #define ENABLE_SOFTWARE_DEBOUNCE // Default disabled. Uncomment to enable.
+
+// ---------------------------------------------------------------------------------------
+
+// TODO: Install compile-time option to send numeric status codes rather than strings.
+
+// ---------------------------------------------------------------------------------------
+// COMPILE-TIME ERROR CHECKING OF DEFINE VALUES:
+
+// #if (ISR_TICKS_PER_ACCELERATION_TICK > 255)
+// #error Parameters ACCELERATION_TICKS / ISR_TICKS must be < 256 to prevent integer overflow.
+// #endif
+
+// ---------------------------------------------------------------------------------------
+
+
+#endif
diff --git a/cpu_map.h b/Marlin/cpu_map.h
similarity index 86%
rename from cpu_map.h
rename to Marlin/cpu_map.h
index 2206a3193..e0add2c80 100644
--- a/cpu_map.h
+++ b/Marlin/cpu_map.h
@@ -1,311 +1,352 @@
-/*
- cpu_map.h - CPU and pin mapping configuration file
- Part of Horus Firmware
-
- Copyright (c) 2014-2015 Mundo Reader S.L.
-
- Horus Firmware is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Horus Firmware is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with Horus Firmware. If not, see .
-*/
-/*
- This file is based on work from Grbl v0.9, distributed under the
- terms of the GPLv3. See COPYING for more details.
- Copyright (c) 2012-2014 Sungeun K. Jeon
-*/
-
-/* The cpu_map.h file serves as a central pin mapping settings file for different processor
- types, i.e. AVR 328p or AVR Mega 2560. Grbl officially supports the Arduino Uno, but the
- other supplied pin mappings are supplied by users, so your results may vary. */
-
-// NOTE: This is still a work in progress. We are still centralizing the configurations to
-// this file, so your success may vary for other CPUs.
-
-#ifndef cpu_map_h
-#define cpu_map_h
-
-//----------------------------------------------------------------------------------------
-
-#ifdef CPU_MAP_ATMEGA328P_HORUS // Arduino Uno for Horus Project
-
- // Serial port pins
- #define SERIAL_RX USART_RX_vect
- #define SERIAL_UDRE USART_UDRE_vect
-
- // Define laser pulse output pins. NOTE: All laser pins must be on the same port.
- #define LASER_DDR DDRD
- #define LASER_PORT PORTD
- #define LASER1_BIT 2 // Uno Digital Pin 2
- #define LASER2_BIT 3 // Uno Digital Pin 3
- #define LASER3_BIT 4 // Uno Digital Pin 4
- #define LASER4_BIT 5 // Uno Digital Pin 5
- #define LASER_MASK ((1<.
+*/
+/*
+ This file is based on work from Grbl v0.9, distributed under the
+ terms of the GPLv3. See COPYING for more details.
+ Copyright (c) 2012-2014 Sungeun K. Jeon
+*/
+
+/* The cpu_map.h file serves as a central pin mapping settings file for different processor
+ types, i.e. AVR 328p or AVR Mega 2560. Grbl officially supports the Arduino Uno, but the
+ other supplied pin mappings are supplied by users, so your results may vary. */
+
+// NOTE: This is still a work in progress. We are still centralizing the configurations to
+// this file, so your success may vary for other CPUs.
+
+#ifndef cpu_map_h
+#define cpu_map_h
+
+//----------------------------------------------------------------------------------------
+#ifdef CPU_MAP_ATMEGA328P_CNCV3 // Arduino Uno for CNC Shield V3
+
+ // Serial port pins
+ #define SERIAL_RX USART_RX_vect
+ #define SERIAL_UDRE USART_UDRE_vect
+
+ // Define laser pulse output pins. NOTE: All laser pins must be on the same port.
+ #define LASER_DDR DDRD
+ #define LASER_PORT PORTD
+ #define LASER1_BIT 4 // Uno Digital Pin 4 Driver Z-STEP
+ #define LASER2_BIT 7 // Uno Digital Pin 7 Driver Z-DIR
+ #define LASER3_BIT 4 // Uno Digital Pin 4
+ #define LASER4_BIT 7 // Uno Digital Pin 7
+ #define LASER_MASK ((1<
-#include
-
-/* These EEPROM bits have different names on different devices. */
-#ifndef EEPE
- #define EEPE EEWE //!< EEPROM program/write enable.
- #define EEMPE EEMWE //!< EEPROM master program/write enable.
-#endif
-
-/* These two are unfortunately not defined in the device include files. */
-#define EEPM1 5 //!< EEPROM Programming Mode Bit 1.
-#define EEPM0 4 //!< EEPROM Programming Mode Bit 0.
-
-/* Define to reduce code size. */
-#define EEPROM_IGNORE_SELFPROG //!< Remove SPM flag polling.
-
-/*! \brief Read byte from EEPROM.
- *
- * This function reads one byte from a given EEPROM address.
- *
- * \note The CPU is halted for 4 clock cycles during EEPROM read.
- *
- * \param addr EEPROM address to read from.
- * \return The byte read from the EEPROM address.
- */
-unsigned char eeprom_get_char( unsigned int addr )
-{
- do {} while( EECR & (1< 0; size--) {
- checksum = (checksum << 1) || (checksum >> 7);
- checksum += *source;
- eeprom_put_char(destination++, *(source++));
- }
- eeprom_put_char(destination, checksum);
-}
-
-int memcpy_from_eeprom_with_checksum(char *destination, unsigned int source, unsigned int size) {
- unsigned char data, checksum = 0;
- for(; size > 0; size--) {
- data = eeprom_get_char(source++);
- checksum = (checksum << 1) || (checksum >> 7);
- checksum += data;
- *(destination++) = data;
- }
- return(checksum == eeprom_get_char(source));
-}
-
+// This file has been prepared for Doxygen automatic documentation generation.
+/*! \file ********************************************************************
+*
+* Atmel Corporation
+*
+* \li File: eeprom.c
+* \li Compiler: IAR EWAAVR 3.10c
+* \li Support mail: avr@atmel.com
+*
+* \li Supported devices: All devices with split EEPROM erase/write
+* capabilities can be used.
+* The example is written for ATmega48.
+*
+* \li AppNote: AVR103 - Using the EEPROM Programming Modes.
+*
+* \li Description: Example on how to use the split EEPROM erase/write
+* capabilities in e.g. ATmega48. All EEPROM
+* programming modes are tested, i.e. Erase+Write,
+* Erase-only and Write-only.
+*
+* $Revision: 1.6 $
+* $Date: Friday, February 11, 2005 07:16:44 UTC $
+****************************************************************************/
+#include
+#include
+
+/* These EEPROM bits have different names on different devices. */
+#ifndef EEPE
+ #define EEPE EEWE //!< EEPROM program/write enable.
+ #define EEMPE EEMWE //!< EEPROM master program/write enable.
+#endif
+
+/* These two are unfortunately not defined in the device include files. */
+#define EEPM1 5 //!< EEPROM Programming Mode Bit 1.
+#define EEPM0 4 //!< EEPROM Programming Mode Bit 0.
+
+/* Define to reduce code size. */
+#define EEPROM_IGNORE_SELFPROG //!< Remove SPM flag polling.
+
+/*! \brief Read byte from EEPROM.
+ *
+ * This function reads one byte from a given EEPROM address.
+ *
+ * \note The CPU is halted for 4 clock cycles during EEPROM read.
+ *
+ * \param addr EEPROM address to read from.
+ * \return The byte read from the EEPROM address.
+ */
+unsigned char eeprom_get_char( unsigned int addr )
+{
+ do {} while( EECR & (1< 0; size--) {
+ checksum = (checksum << 1) || (checksum >> 7);
+ checksum += *source;
+ eeprom_put_char(destination++, *(source++));
+ }
+ eeprom_put_char(destination, checksum);
+}
+
+int memcpy_from_eeprom_with_checksum(char *destination, unsigned int source, unsigned int size) {
+ unsigned char data, checksum = 0;
+ for(; size > 0; size--) {
+ data = eeprom_get_char(source++);
+ checksum = (checksum << 1) || (checksum >> 7);
+ checksum += data;
+ *(destination++) = data;
+ }
+ return(checksum == eeprom_get_char(source));
+}
+
// end of file
diff --git a/eeprom.h b/Marlin/eeprom.h
similarity index 99%
rename from eeprom.h
rename to Marlin/eeprom.h
index a980ec746..1245254d9 100644
--- a/eeprom.h
+++ b/Marlin/eeprom.h
@@ -31,4 +31,4 @@ void eeprom_put_char(unsigned int addr, unsigned char new_value);
void memcpy_to_eeprom_with_checksum(unsigned int destination, char *source, unsigned int size);
int memcpy_from_eeprom_with_checksum(char *destination, unsigned int source, unsigned int size);
-#endif
+#endif
diff --git a/gcode.c b/Marlin/gcode.c
similarity index 99%
rename from gcode.c
rename to Marlin/gcode.c
index 4874fb11a..be4fee276 100644
--- a/gcode.c
+++ b/Marlin/gcode.c
@@ -750,4 +750,4 @@ uint8_t gc_execute_line(char *line)
group 10 = {G98, G99} return mode canned cycles
group 13 = {G61, G61.1, G64} path control mode
group 14 = {M50} LDR read
-*/
+*/
diff --git a/gcode.h b/Marlin/gcode.h
similarity index 99%
rename from gcode.h
rename to Marlin/gcode.h
index eb425c418..a4cfc0574 100644
--- a/gcode.h
+++ b/Marlin/gcode.h
@@ -213,4 +213,4 @@ uint8_t gc_execute_line(char *line);
// Set g-code parser position. Input in steps.
void gc_sync_position();
-#endif
+#endif
diff --git a/laser_control.c b/Marlin/laser_control.c
similarity index 99%
rename from laser_control.c
rename to Marlin/laser_control.c
index ff044dc34..4982e3197 100644
--- a/laser_control.c
+++ b/Marlin/laser_control.c
@@ -101,4 +101,4 @@ ISR(TIMER2_COMPA_vect)
laser_set(i, LASER_DISABLE);
}
}
-}
\ No newline at end of file
+}
diff --git a/laser_control.h b/Marlin/laser_control.h
similarity index 99%
rename from laser_control.h
rename to Marlin/laser_control.h
index 6e67a0fab..e9006ce1a 100644
--- a/laser_control.h
+++ b/Marlin/laser_control.h
@@ -27,4 +27,4 @@ void laser_off(uint8_t laser_bit);
void laser_on(uint8_t laser_bit);
void laser_run(uint8_t mode, uint8_t value);
-#endif
\ No newline at end of file
+#endif
diff --git a/ldr.c b/Marlin/ldr.c
similarity index 99%
rename from ldr.c
rename to Marlin/ldr.c
index cd5ae0197..50890a82f 100644
--- a/ldr.c
+++ b/Marlin/ldr.c
@@ -42,4 +42,4 @@ void print_ldr(uint8_t tool){
printString(buffer);
printString("\r\n");
}
-}
\ No newline at end of file
+}
diff --git a/ldr.h b/Marlin/ldr.h
similarity index 99%
rename from ldr.h
rename to Marlin/ldr.h
index 9ed8e019a..f94a1a4c8 100644
--- a/ldr.h
+++ b/Marlin/ldr.h
@@ -31,4 +31,4 @@
void ldr_init(void);
uint16_t ldr_read(uint8_t channel);
-#endif
\ No newline at end of file
+#endif
diff --git a/main.c b/Marlin/main.c
similarity index 99%
rename from main.c
rename to Marlin/main.c
index 354258e15..eba176b5e 100644
--- a/main.c
+++ b/Marlin/main.c
@@ -95,4 +95,4 @@ int main(void)
}
return 0; /* Never reached */
-}
+}
diff --git a/motion_control.c b/Marlin/motion_control.c
similarity index 99%
rename from motion_control.c
rename to Marlin/motion_control.c
index 8767bde70..0893a0fb5 100644
--- a/motion_control.c
+++ b/Marlin/motion_control.c
@@ -370,4 +370,4 @@ void mc_reset()
st_go_idle(); // Force kill steppers. Position has likely been lost.
}
}
-}
+}
diff --git a/motion_control.h b/Marlin/motion_control.h
similarity index 99%
rename from motion_control.h
rename to Marlin/motion_control.h
index 8eb2c9bf7..29207b02d 100644
--- a/motion_control.h
+++ b/Marlin/motion_control.h
@@ -66,4 +66,4 @@ void mc_probe_cycle(float *target, float feed_rate, uint8_t invert_feed_rate);
// Performs system reset. If in motion state, kills all motion and sets system alarm.
void mc_reset();
-#endif
+#endif
diff --git a/nuts_bolts.c b/Marlin/nuts_bolts.c
similarity index 99%
rename from nuts_bolts.c
rename to Marlin/nuts_bolts.c
index 10f31e6cd..7d50a59c3 100644
--- a/nuts_bolts.c
+++ b/Marlin/nuts_bolts.c
@@ -146,4 +146,4 @@ void delay_us(uint32_t us)
// Simple hypotenuse computation function.
-float hypot_f(float x, float y) { return(sqrt(x*x + y*y)); }
+float hypot_f(float x, float y) { return(sqrt(x*x + y*y)); }
diff --git a/nuts_bolts.h b/Marlin/nuts_bolts.h
similarity index 99%
rename from nuts_bolts.h
rename to Marlin/nuts_bolts.h
index 8f446f414..3660057a4 100644
--- a/nuts_bolts.h
+++ b/Marlin/nuts_bolts.h
@@ -72,4 +72,4 @@ void delay_us(uint32_t us);
// Computes hypotenuse, avoiding avr-gcc's bloated version and the extra error checking.
float hypot_f(float x, float y);
-#endif
+#endif
diff --git a/planner.c b/Marlin/planner.c
similarity index 99%
rename from planner.c
rename to Marlin/planner.c
index 1721eefc4..0463cec4f 100644
--- a/planner.c
+++ b/Marlin/planner.c
@@ -426,4 +426,4 @@ void plan_cycle_reinitialize()
st_update_plan_block_parameters();
block_buffer_planned = block_buffer_tail;
planner_recalculate();
-}
+}
diff --git a/planner.h b/Marlin/planner.h
similarity index 99%
rename from planner.h
rename to Marlin/planner.h
index 8409268a9..1b2f15afa 100644
--- a/planner.h
+++ b/Marlin/planner.h
@@ -99,4 +99,4 @@ uint8_t plan_get_block_buffer_count();
// Returns the status of the block ring buffer. True, if buffer is full.
uint8_t plan_check_full_buffer();
-#endif
+#endif
diff --git a/print.c b/Marlin/print.c
similarity index 99%
rename from print.c
rename to Marlin/print.c
index a3b63513b..e9372038a 100644
--- a/print.c
+++ b/Marlin/print.c
@@ -209,4 +209,4 @@ void printFreeMemory()
free = (int) &free - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
printInteger((int32_t)free);
printString(" ");
-}
+}
diff --git a/print.h b/Marlin/print.h
similarity index 99%
rename from print.h
rename to Marlin/print.h
index ce8ed61c8..183ad6b20 100644
--- a/print.h
+++ b/Marlin/print.h
@@ -55,4 +55,4 @@ void printFloat_SettingValue(float n);
// Debug tool to print free memory in bytes at the called point. Not used otherwise.
void printFreeMemory();
-#endif
\ No newline at end of file
+#endif
diff --git a/probe.c b/Marlin/probe.c
similarity index 99%
rename from probe.c
rename to Marlin/probe.c
index 62197addc..3fc8c3e8d 100644
--- a/probe.c
+++ b/Marlin/probe.c
@@ -61,4 +61,4 @@ void probe_state_monitor()
bit_true(sys.execute, EXEC_FEED_HOLD);
}
}
-}
+}
diff --git a/probe.h b/Marlin/probe.h
similarity index 99%
rename from probe.h
rename to Marlin/probe.h
index b63990d5e..9accafd1d 100644
--- a/probe.h
+++ b/Marlin/probe.h
@@ -41,4 +41,4 @@ uint8_t probe_get_state();
// stepper ISR per ISR tick.
void probe_state_monitor();
-#endif
+#endif
diff --git a/protocol.c b/Marlin/protocol.c
similarity index 99%
rename from protocol.c
rename to Marlin/protocol.c
index fdb556aa6..0522023ed 100644
--- a/protocol.c
+++ b/Marlin/protocol.c
@@ -304,4 +304,4 @@ void protocol_buffer_synchronize()
// NOTE: This function is called from the main loop and mc_line() only and executes when one of
// two conditions exist respectively: There are no more blocks sent (i.e. streaming is finished,
// single commands), or the planner buffer is full and ready to go.
-void protocol_auto_cycle_start() { if (sys.auto_start) { bit_true_atomic(sys.execute, EXEC_CYCLE_START); } }
+void protocol_auto_cycle_start() { if (sys.auto_start) { bit_true_atomic(sys.execute, EXEC_CYCLE_START); } }
diff --git a/protocol.h b/Marlin/protocol.h
similarity index 99%
rename from protocol.h
rename to Marlin/protocol.h
index 26b968a8f..b8101d037 100644
--- a/protocol.h
+++ b/Marlin/protocol.h
@@ -59,4 +59,4 @@ void protocol_auto_cycle_start();
// Block until all buffered steps are executed
void protocol_buffer_synchronize();
-#endif
+#endif
diff --git a/report.c b/Marlin/report.c
similarity index 99%
rename from report.c
rename to Marlin/report.c
index c2f4d08b1..2f6d19e9b 100644
--- a/report.c
+++ b/Marlin/report.c
@@ -444,4 +444,4 @@ void report_realtime_status()
#endif
printPgmString(PSTR(">\r\n"));
-}
+}
diff --git a/report.h b/Marlin/report.h
similarity index 99%
rename from report.h
rename to Marlin/report.h
index bfc1fd4e7..3b90b1392 100644
--- a/report.h
+++ b/Marlin/report.h
@@ -108,4 +108,4 @@ void report_startup_line(uint8_t n, char *line);
// Prints build info and user info
void report_build_info(char *line);
-#endif
+#endif
diff --git a/serial.c b/Marlin/serial.c
similarity index 99%
rename from serial.c
rename to Marlin/serial.c
index 8add31af0..13174cc0c 100644
--- a/serial.c
+++ b/Marlin/serial.c
@@ -206,4 +206,4 @@ void serial_reset_read_buffer()
#ifdef ENABLE_XONXOFF
flow_ctrl = XON_SENT;
#endif
-}
+}
diff --git a/serial.h b/Marlin/serial.h
similarity index 99%
rename from serial.h
rename to Marlin/serial.h
index 2ad9ab79c..426ad42eb 100644
--- a/serial.h
+++ b/Marlin/serial.h
@@ -66,4 +66,4 @@ uint8_t serial_get_rx_buffer_count();
// NOTE: Not used except for debugging and ensuring no TX bottlenecks.
uint8_t serial_get_tx_buffer_count();
-#endif
+#endif
diff --git a/settings.c b/Marlin/settings.c
similarity index 99%
rename from settings.c
rename to Marlin/settings.c
index 0a9c39899..5882882ec 100644
--- a/settings.c
+++ b/Marlin/settings.c
@@ -337,4 +337,4 @@ uint8_t get_limit_pin_mask(uint8_t axis_idx)
if ( axis_idx == X_AXIS ) { return((1<