simplified the includes, makefile now works with arduino23
This commit is contained in:
parent
3c1a4aac2b
commit
57f9359a41
|
@ -4,6 +4,8 @@
|
|||
#include "Marlin.h"
|
||||
#include "planner.h"
|
||||
#include "temperature.h"
|
||||
//#include <EEPROM.h>
|
||||
|
||||
|
||||
|
||||
template <class T> int EEPROM_writeAnything(int &ee, const T& value)
|
||||
|
@ -11,7 +13,7 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -20,7 +22,7 @@ template <class T> int EEPROM_readAnything(int &ee, T& value)
|
|||
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;
|
||||
}
|
||||
//======================================================================================
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
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
|
||||
|
||||
|
@ -60,13 +60,25 @@ OPT = 2
|
|||
#~ 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
|
||||
|
@ -253,7 +265,8 @@ applet/$(TARGET).elf: $(TARGET).pde applet/$(TARGET).cpp.o applet/core.a
|
|||
# $(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 :"
|
||||
|
|
|
@ -1,35 +1,55 @@
|
|||
// 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>
|
||||
#include <math.h>
|
||||
#include <util/delay.h>
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#define FORCE_INLINE __attribute__((always_inline)) inline
|
||||
|
||||
#include <math.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
|
||||
|
|
|
@ -25,15 +25,9 @@
|
|||
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"
|
||||
|
@ -42,7 +36,7 @@
|
|||
#include "motion_control.h"
|
||||
#include "cardreader.h"
|
||||
#include "watchdog.h"
|
||||
|
||||
#include "EEPROMwrite.h"
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -20,25 +20,14 @@
|
|||
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"
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -21,13 +21,8 @@
|
|||
|
||||
#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
|
||||
|
|
|
@ -17,12 +17,7 @@
|
|||
* along with the Arduino Sd2Card Library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#define HardwareSerial_h // trick to disable the standard HWserial
|
||||
#if ARDUINO < 100
|
||||
#include <WProgram.h>
|
||||
#else // ARDUINO
|
||||
#include <Arduino.h>
|
||||
#endif // ARDUINO
|
||||
#include "Marlin.h"
|
||||
#include "Sd2Card.h"
|
||||
//------------------------------------------------------------------------------
|
||||
#ifndef SOFTWARE_SPI
|
||||
|
|
|
@ -23,14 +23,7 @@
|
|||
* \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"
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
|
@ -17,7 +17,9 @@
|
|||
* 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.
|
||||
|
|
|
@ -23,14 +23,7 @@
|
|||
* \file
|
||||
* \brief Useful utility functions.
|
||||
*/
|
||||
#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 "Marlin.h"
|
||||
#include "MarlinSerial.h"
|
||||
/** Store and print a string in flash memory.*/
|
||||
#define PgmPrint(x) SerialPrint_P(PSTR(x))
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* along with the Arduino SdFat Library. If not, see
|
||||
* <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "Marlin.h"
|
||||
#include "SdFile.h"
|
||||
/** Create a file object and open it in the current working directory.
|
||||
*
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
* \brief SdFile class
|
||||
*/
|
||||
#include "SdBaseFile.h"
|
||||
#include "Marlin.h"
|
||||
#include <Print.h>
|
||||
#ifndef SdFile_h
|
||||
#define SdFile_h
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
#include "Marlin.h"
|
||||
#include "cardreader.h"
|
||||
#ifdef SDSUPPORT
|
||||
|
||||
#include "Marlin.h"
|
||||
|
||||
|
||||
CardReader::CardReader()
|
||||
{
|
||||
|
|
|
@ -98,12 +98,7 @@ extern unsigned long axis_steps_per_sqr_second[NUM_AXIS];
|
|||
#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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef SPEED_LOOKUPTABLE_H
|
||||
#define SPEED_LOOKUPTABLE_H
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
#include "Marlin.h"
|
||||
|
||||
uint16_t speed_lookuptable_fast[256][2] PROGMEM = {\
|
||||
{ 62500, 55556}, { 6944, 3268}, { 3676, 1176}, { 2500, 607}, { 1893, 369}, { 1524, 249}, { 1275, 179}, { 1096, 135},
|
||||
|
|
|
@ -22,9 +22,10 @@
|
|||
and Philipp Tiefenbacher. */
|
||||
|
||||
|
||||
#include "stepper.h"
|
||||
|
||||
|
||||
#include "Marlin.h"
|
||||
#include "stepper.h"
|
||||
#include "planner.h"
|
||||
#include "temperature.h"
|
||||
#include "ultralcd.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef THERMISTORTABLES_H_
|
||||
#define THERMISTORTABLES_H_
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
#include "Marlin.h"
|
||||
|
||||
#define OVERSAMPLENR 16
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "ultralcd.h"
|
||||
#ifdef ULTRA_LCD
|
||||
#include "Marlin.h"
|
||||
#include <LiquidCrystal.h>
|
||||
//===========================================================================
|
||||
//=============================imported variables============================
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifdef USE_WATCHDOG
|
||||
#include "Marlin.h"
|
||||
#include "watchdog.h"
|
||||
#include <avr/wdt.h>
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
//===========================================================================
|
||||
//=============================private variables ============================
|
||||
|
|
Loading…
Reference in a new issue