#include "Marlin.h"
#include "planner.h"
#include "temperature.h"
+//#include <EEPROM.h>
+
template <class T> int EEPROM_writeAnything(int &ee, const T& value)
const byte* p = (const byte*)(const void*)&value;
int i;
for (i = 0; i < (int)sizeof(value); i++)
- EEPROM.write(ee++, *p++);
+ eeprom_write_byte((unsigned char *)ee++, *p++);
return i;
}
byte* p = (byte*)(void*)&value;
int i;
for (i = 0; i < (int)sizeof(value); i++)
- *p++ = EEPROM.read(ee++);
+ *p++ = eeprom_read_byte((unsigned char *)ee++);
return i;
}
//======================================================================================
TARGET = $(notdir $(CURDIR))
# CHANGE BELOW:
#~ INSTALL_DIR = /Applications/Arduino.app/Contents/Resources/Java
-INSTALL_DIR = /home/bkubicek/software/arduino-0022
+INSTALL_DIR = /home/bkubicek/software/arduino-0023
#~ PORT = /dev/cu.usbserial*
PORT = /dev/ttyACM0
#~ CDEFS = -DBUILD_F_CPU=$(BUILD_F_CPU)
#~ CXXDEFS = -DBUILD_F_CPU=$(BUILD_F_CPU)
# now called DF_CPU
-CDEFS = -DF_CPU=$(BUILD_F_CPU) -DARDUINO=22
-CXXDEFS = -DF_CPU=$(BUILD_F_CPU) -DARDUINO=22
+CDEFS = -DF_CPU=$(BUILD_F_CPU) -DARDUINO=23
+CXXDEFS = -DF_CPU=$(BUILD_F_CPU) -DARDUINO=23
# Place -I options here
CINCS = -I$(ARDUINO) -I$(INSTALL_DIR)/libraries/LiquidCrystal/ -I$(INSTALL_DIR)/libraries/EEPROM/
CXXINCS = -I$(ARDUINO)
+OBJECTS= applet/Marlin.cpp.o \
+ applet/EEPROM.o \
+ applet/pins_arduino.o \
+ applet/wiring_analog.o \
+ applet/wiring_pulse.o \
+ applet/main.o \
+ applet/Print.o \
+ applet/wiring_digital.o \
+ applet/wiring_shift.o \
+ applet/stepper.o \
+ applet/wiring.o \
+ applet/WMath.o
# Compiler flag to set the C Standard level.
# c89 - "ANSI" C
# gnu89 - c89 plus GCC extensions
# $(CC) $(ALL_CFLAGS) -o $@ applet/$(TARGET).cpp -L. applet/core.a $(LDFLAGS)
# changed as in IDE v0022: link cpp obj files
@echo $$(tput bold)$$(tput setaf 2) $(CC) $$(tput sgr0) $(ALL_CFLAGS) $(CFINALF) -o $@ applet/$(TARGET).cpp.o $(CXXOBJ) -L. applet/core.a $(LDFLAGS)
- @$(CC) $(ALL_CFLAGS) $(CFINALF) -o $@ applet/$(TARGET).cpp.o $(CXXOBJ) -L. applet/core.a $(LDFLAGS)
+ $(CC) $(ALL_CFLAGS) $(CFINALF) -o $@ $OBJECTS -L. applet/core.a $(LDFLAGS)
+ #@$(CC) $(ALL_CFLAGS) $(CFINALF) -o $@ applet/*.o applet/$(TARGET).cpp.o $(CXXOBJ) -L. applet/core.a $(LDFLAGS)
# added: cpp.o depends on cpp (and .pde which generates it)
# $< "first item in the dependencies list"; $@ "left side of the :"; $^ "right side of the :"
+// Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware.
+// Licence: GPL
+
#ifndef __MARLINH
#define __MARLINH
-// Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware.
-// Licence: GPL
#define HardwareSerial_h // trick to disable the standard HWserial
-#include <stdio.h>
+
+#define FORCE_INLINE __attribute__((always_inline)) inline
+
#include <math.h>
-#include <util/delay.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <inttypes.h>
+
+#include <avr/delay.h>
#include <avr/pgmspace.h>
+#include <avr/eeprom.h>
+#include <avr/wdt.h>
+#include <avr/interrupt.h>
+
+
+
+
+
+
+
+#include "fastio.h"
+#include "Configuration.h"
+#include "pins.h"
+
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
-#include <EEPROM.h>
-
-#include "fastio.h"
-#include "Configuration.h"
-#include "pins.h"
#include "MarlinSerial.h"
-#define FORCE_INLINE __attribute__((always_inline)) inline
-//#define SERIAL_ECHO(x) Serial << "echo: " << x;
-//#define SERIAL_ECHOLN(x) Serial << "echo: "<<x<<endl;
-//#define SERIAL_ERROR(x) Serial << "Error: " << x;
-//#define SERIAL_ERRORLN(x) Serial << "Error: " << x<<endl;
-//#define SERIAL_PROTOCOL(x) Serial << x;
-//#define SERIAL_PROTOCOLLN(x) Serial << x<<endl;
+#ifndef cbi
+#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
+#endif
+#ifndef sbi
+#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
+#endif
+
+#include "WString.h"
+
+
//this is a unfinsihed attemp to removes a lot of warning messages, see:
// http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=57011
http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
*/
-
#include "Marlin.h"
-#include <EEPROM.h>
-#include <stdio.h>
-#include "EEPROMwrite.h"
-#include "fastio.h"
-#include "Configuration.h"
-#include "pins.h"
+
#include "ultralcd.h"
#include "planner.h"
#include "motion_control.h"
#include "cardreader.h"
#include "watchdog.h"
-
+#include "EEPROMwrite.h"
Modified 28 September 2010 by Mark Sproul
*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-#include <math.h>
-#if ARDUINO >= 100
- #include "Arduino.h"
-#else
- #include "wiring.h"
-#endif
-#include "wiring_private.h"
+#include "Marlin.h"
+#include "MarlinSerial.h"
// this next line disables the entire HardwareSerial.cpp,
// this is so I can support Attiny series and any other chip without a uart
#if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)
-#include "MarlinSerial.h"
-#include "Marlin.h"
+
#ifndef MarlinSerial_h
#define MarlinSerial_h
-#include <math.h>
-#include <inttypes.h>
-//#include <Stream.h>
-#include <string.h>
-#define FORCE_INLINE __attribute__((always_inline)) inline
+#include "Marlin.h"
-#include "WString.h"
#define DEC 10
#define HEX 16
* along with the Arduino Sd2Card Library. If not, see\r
* <http://www.gnu.org/licenses/>.\r
*/\r
-#define HardwareSerial_h // trick to disable the standard HWserial\r
-#if ARDUINO < 100\r
-#include <WProgram.h>\r
-#else // ARDUINO\r
-#include <Arduino.h>\r
-#endif // ARDUINO\r
+#include "Marlin.h"\r
#include "Sd2Card.h"\r
//------------------------------------------------------------------------------\r
#ifndef SOFTWARE_SPI\r
* \file
* \brief SdBaseFile class
*/
-#include <avr/pgmspace.h>
-#define HardwareSerial_h // trick to disable the standard HWserial
-#if ARDUINO < 100
-#include <WProgram.h>
-#else // ARDUINO
-#include <Arduino.h>
-#endif // ARDUINO
-#include "MarlinSerial.h"
+#include "Marlin.h"
#include "SdFatConfig.h"
#include "SdVolume.h"
//------------------------------------------------------------------------------
* along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>.
*/
+#include "Marlin.h"
#include "SdFatUtil.h"
+
//------------------------------------------------------------------------------
/** Amount of free RAM
* \return The number of free bytes.
* \file\r
* \brief Useful utility functions.\r
*/\r
-#include <avr/pgmspace.h>\r
-\r
-#define HardwareSerial_h // trick to disable the standard HWserial\r
-#if ARDUINO < 100\r
-#include <WProgram.h>\r
-#else // ARDUINO\r
-#include <Arduino.h>\r
-#endif // ARDUINO\r
+#include "Marlin.h"\r
#include "MarlinSerial.h"\r
/** Store and print a string in flash memory.*/\r
#define PgmPrint(x) SerialPrint_P(PSTR(x))\r
* along with the Arduino SdFat Library. If not, see\r
* <http://www.gnu.org/licenses/>.\r
*/\r
+#include "Marlin.h"\r
#include "SdFile.h"\r
/** Create a file object and open it in the current working directory.\r
*\r
* \brief SdFile class
*/
#include "SdBaseFile.h"
+#include "Marlin.h"
#include <Print.h>
#ifndef SdFile_h
#define SdFile_h
+#include "Marlin.h"
#include "cardreader.h"
#ifdef SDSUPPORT
-#include "Marlin.h"
+
CardReader::CardReader()
{
#endif
-/////semi-private stuff
-#if ARDUINO >= 100
- #include "Arduino.h"
-#else
- #include "WProgram.h"
-#endif
+
extern block_t block_buffer[BLOCK_BUFFER_SIZE]; // A ring buffer for motion instfructions
extern volatile unsigned char block_buffer_head; // Index of the next block to be pushed
#ifndef SPEED_LOOKUPTABLE_H\r
#define SPEED_LOOKUPTABLE_H\r
\r
-#include <avr/pgmspace.h>\r
+#include "Marlin.h"\r
\r
uint16_t speed_lookuptable_fast[256][2] PROGMEM = {\\r
{ 62500, 55556}, { 6944, 3268}, { 3676, 1176}, { 2500, 607}, { 1893, 369}, { 1524, 249}, { 1275, 179}, { 1096, 135}, \r
and Philipp Tiefenbacher. */
-#include "stepper.h"
+
#include "Marlin.h"
+#include "stepper.h"
#include "planner.h"
#include "temperature.h"
#include "ultralcd.h"
#ifndef THERMISTORTABLES_H_
#define THERMISTORTABLES_H_
-#include <avr/pgmspace.h>
+#include "Marlin.h"
#define OVERSAMPLENR 16
#include "ultralcd.h"
#ifdef ULTRA_LCD
+#include "Marlin.h"
#include <LiquidCrystal.h>
//===========================================================================
//=============================imported variables============================
#ifdef USE_WATCHDOG
+#include "Marlin.h"
#include "watchdog.h"
-#include <avr/wdt.h>
-#include <avr/interrupt.h>
//===========================================================================
//=============================private variables ============================