simplified the includes, makefile now works with arduino23

This commit is contained in:
Bernhard 2011-12-22 14:55:45 +01:00
parent 3c1a4aac2b
commit 57f9359a41
19 changed files with 81 additions and 86 deletions

View File

@ -4,6 +4,8 @@
#include "Marlin.h" #include "Marlin.h"
#include "planner.h" #include "planner.h"
#include "temperature.h" #include "temperature.h"
//#include <EEPROM.h>
template <class T> int EEPROM_writeAnything(int &ee, const T& value) 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; const byte* p = (const byte*)(const void*)&value;
int i; int i;
for (i = 0; i < (int)sizeof(value); i++) for (i = 0; i < (int)sizeof(value); i++)
EEPROM.write(ee++, *p++); eeprom_write_byte((unsigned char *)ee++, *p++);
return i; return i;
} }
@ -20,7 +22,7 @@ template <class T> int EEPROM_readAnything(int &ee, T& value)
byte* p = (byte*)(void*)&value; byte* p = (byte*)(void*)&value;
int i; int i;
for (i = 0; i < (int)sizeof(value); i++) for (i = 0; i < (int)sizeof(value); i++)
*p++ = EEPROM.read(ee++); *p++ = eeprom_read_byte((unsigned char *)ee++);
return i; return i;
} }
//====================================================================================== //======================================================================================

View File

@ -1,7 +1,7 @@
TARGET = $(notdir $(CURDIR)) TARGET = $(notdir $(CURDIR))
# CHANGE BELOW: # CHANGE BELOW:
#~ INSTALL_DIR = /Applications/Arduino.app/Contents/Resources/Java #~ 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/cu.usbserial*
PORT = /dev/ttyACM0 PORT = /dev/ttyACM0
@ -60,13 +60,25 @@ OPT = 2
#~ CDEFS = -DBUILD_F_CPU=$(BUILD_F_CPU) #~ CDEFS = -DBUILD_F_CPU=$(BUILD_F_CPU)
#~ CXXDEFS = -DBUILD_F_CPU=$(BUILD_F_CPU) #~ CXXDEFS = -DBUILD_F_CPU=$(BUILD_F_CPU)
# now called DF_CPU # now called DF_CPU
CDEFS = -DF_CPU=$(BUILD_F_CPU) -DARDUINO=22 CDEFS = -DF_CPU=$(BUILD_F_CPU) -DARDUINO=23
CXXDEFS = -DF_CPU=$(BUILD_F_CPU) -DARDUINO=22 CXXDEFS = -DF_CPU=$(BUILD_F_CPU) -DARDUINO=23
# Place -I options here # Place -I options here
CINCS = -I$(ARDUINO) -I$(INSTALL_DIR)/libraries/LiquidCrystal/ -I$(INSTALL_DIR)/libraries/EEPROM/ CINCS = -I$(ARDUINO) -I$(INSTALL_DIR)/libraries/LiquidCrystal/ -I$(INSTALL_DIR)/libraries/EEPROM/
CXXINCS = -I$(ARDUINO) 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. # Compiler flag to set the C Standard level.
# c89 - "ANSI" C # c89 - "ANSI" C
# gnu89 - c89 plus GCC extensions # 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) # $(CC) $(ALL_CFLAGS) -o $@ applet/$(TARGET).cpp -L. applet/core.a $(LDFLAGS)
# changed as in IDE v0022: link cpp obj files # 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) @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) # 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 :" # $< "first item in the dependencies list"; $@ "left side of the :"; $^ "right side of the :"

View File

@ -1,35 +1,55 @@
// Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware.
// Licence: GPL
#ifndef __MARLINH #ifndef __MARLINH
#define __MARLINH #define __MARLINH
// Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware.
// Licence: GPL
#define HardwareSerial_h // trick to disable the standard HWserial #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 #if ARDUINO >= 100
#include "Arduino.h" #include "Arduino.h"
#else #else
#include "WProgram.h" #include "WProgram.h"
#endif #endif
#include <EEPROM.h>
#include "fastio.h"
#include "Configuration.h"
#include "pins.h"
#include "MarlinSerial.h" #include "MarlinSerial.h"
#define FORCE_INLINE __attribute__((always_inline)) inline #ifndef cbi
//#define SERIAL_ECHO(x) Serial << "echo: " << x; #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
//#define SERIAL_ECHOLN(x) Serial << "echo: "<<x<<endl; #endif
//#define SERIAL_ERROR(x) Serial << "Error: " << x; #ifndef sbi
//#define SERIAL_ERRORLN(x) Serial << "Error: " << x<<endl; #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
//#define SERIAL_PROTOCOL(x) Serial << x; #endif
//#define SERIAL_PROTOCOLLN(x) Serial << x<<endl;
#include "WString.h"
//this is a unfinsihed attemp to removes a lot of warning messages, see: //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://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=57011

View File

@ -25,15 +25,9 @@
http://reprap.org/pipermail/reprap-dev/2011-May/003323.html http://reprap.org/pipermail/reprap-dev/2011-May/003323.html
*/ */
#include "Marlin.h" #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 "ultralcd.h"
#include "planner.h" #include "planner.h"
@ -42,7 +36,7 @@
#include "motion_control.h" #include "motion_control.h"
#include "cardreader.h" #include "cardreader.h"
#include "watchdog.h" #include "watchdog.h"
#include "EEPROMwrite.h"

View File

@ -20,25 +20,14 @@
Modified 28 September 2010 by Mark Sproul Modified 28 September 2010 by Mark Sproul
*/ */
#include "Marlin.h"
#include <stdlib.h> #include "MarlinSerial.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"
// this next line disables the entire HardwareSerial.cpp, // this next line disables the entire HardwareSerial.cpp,
// this is so I can support Attiny series and any other chip without a uart // 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) #if defined(UBRRH) || defined(UBRR0H) || defined(UBRR1H) || defined(UBRR2H) || defined(UBRR3H)
#include "MarlinSerial.h"
#include "Marlin.h"

View File

@ -21,13 +21,8 @@
#ifndef MarlinSerial_h #ifndef MarlinSerial_h
#define MarlinSerial_h #define MarlinSerial_h
#include <math.h> #include "Marlin.h"
#include <inttypes.h>
//#include <Stream.h>
#include <string.h>
#define FORCE_INLINE __attribute__((always_inline)) inline
#include "WString.h"
#define DEC 10 #define DEC 10
#define HEX 16 #define HEX 16

View File

@ -17,12 +17,7 @@
* along with the Arduino Sd2Card Library. If not, see * along with the Arduino Sd2Card Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#define HardwareSerial_h // trick to disable the standard HWserial #include "Marlin.h"
#if ARDUINO < 100
#include <WProgram.h>
#else // ARDUINO
#include <Arduino.h>
#endif // ARDUINO
#include "Sd2Card.h" #include "Sd2Card.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#ifndef SOFTWARE_SPI #ifndef SOFTWARE_SPI

View File

@ -23,14 +23,7 @@
* \file * \file
* \brief SdBaseFile class * \brief SdBaseFile class
*/ */
#include <avr/pgmspace.h> #include "Marlin.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 "SdFatConfig.h" #include "SdFatConfig.h"
#include "SdVolume.h" #include "SdVolume.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@ -17,7 +17,9 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#include "SdFatUtil.h" #include "SdFatUtil.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
/** Amount of free RAM /** Amount of free RAM
* \return The number of free bytes. * \return The number of free bytes.

View File

@ -23,14 +23,7 @@
* \file * \file
* \brief Useful utility functions. * \brief Useful utility functions.
*/ */
#include <avr/pgmspace.h> #include "Marlin.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 "MarlinSerial.h"
/** Store and print a string in flash memory.*/ /** Store and print a string in flash memory.*/
#define PgmPrint(x) SerialPrint_P(PSTR(x)) #define PgmPrint(x) SerialPrint_P(PSTR(x))

View File

@ -17,6 +17,7 @@
* along with the Arduino SdFat Library. If not, see * along with the Arduino SdFat Library. If not, see
* <http://www.gnu.org/licenses/>. * <http://www.gnu.org/licenses/>.
*/ */
#include "Marlin.h"
#include "SdFile.h" #include "SdFile.h"
/** Create a file object and open it in the current working directory. /** Create a file object and open it in the current working directory.
* *

View File

@ -22,6 +22,7 @@
* \brief SdFile class * \brief SdFile class
*/ */
#include "SdBaseFile.h" #include "SdBaseFile.h"
#include "Marlin.h"
#include <Print.h> #include <Print.h>
#ifndef SdFile_h #ifndef SdFile_h
#define SdFile_h #define SdFile_h

View File

@ -1,7 +1,8 @@
#include "Marlin.h"
#include "cardreader.h" #include "cardreader.h"
#ifdef SDSUPPORT #ifdef SDSUPPORT
#include "Marlin.h"
CardReader::CardReader() CardReader::CardReader()
{ {

View File

@ -98,12 +98,7 @@ extern unsigned long axis_steps_per_sqr_second[NUM_AXIS];
#endif #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 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 extern volatile unsigned char block_buffer_head; // Index of the next block to be pushed

View File

@ -1,7 +1,7 @@
#ifndef SPEED_LOOKUPTABLE_H #ifndef SPEED_LOOKUPTABLE_H
#define SPEED_LOOKUPTABLE_H #define SPEED_LOOKUPTABLE_H
#include <avr/pgmspace.h> #include "Marlin.h"
uint16_t speed_lookuptable_fast[256][2] PROGMEM = {\ uint16_t speed_lookuptable_fast[256][2] PROGMEM = {\
{ 62500, 55556}, { 6944, 3268}, { 3676, 1176}, { 2500, 607}, { 1893, 369}, { 1524, 249}, { 1275, 179}, { 1096, 135}, { 62500, 55556}, { 6944, 3268}, { 3676, 1176}, { 2500, 607}, { 1893, 369}, { 1524, 249}, { 1275, 179}, { 1096, 135},

View File

@ -22,9 +22,10 @@
and Philipp Tiefenbacher. */ and Philipp Tiefenbacher. */
#include "stepper.h"
#include "Marlin.h" #include "Marlin.h"
#include "stepper.h"
#include "planner.h" #include "planner.h"
#include "temperature.h" #include "temperature.h"
#include "ultralcd.h" #include "ultralcd.h"

View File

@ -1,7 +1,7 @@
#ifndef THERMISTORTABLES_H_ #ifndef THERMISTORTABLES_H_
#define THERMISTORTABLES_H_ #define THERMISTORTABLES_H_
#include <avr/pgmspace.h> #include "Marlin.h"
#define OVERSAMPLENR 16 #define OVERSAMPLENR 16

View File

@ -1,5 +1,6 @@
#include "ultralcd.h" #include "ultralcd.h"
#ifdef ULTRA_LCD #ifdef ULTRA_LCD
#include "Marlin.h"
#include <LiquidCrystal.h> #include <LiquidCrystal.h>
//=========================================================================== //===========================================================================
//=============================imported variables============================ //=============================imported variables============================

View File

@ -1,7 +1,6 @@
#ifdef USE_WATCHDOG #ifdef USE_WATCHDOG
#include "Marlin.h"
#include "watchdog.h" #include "watchdog.h"
#include <avr/wdt.h>
#include <avr/interrupt.h>
//=========================================================================== //===========================================================================
//=============================private variables ============================ //=============================private variables ============================