Merge branch 'Marlin_v1' of github.com:ErikZalm/Marlin into Marlin_v1

This commit is contained in:
Daid 2012-12-13 11:41:34 +01:00
commit 673577a31b
4 changed files with 38 additions and 27 deletions

View File

@ -229,6 +229,22 @@ OPT = s
DEFINES ?= DEFINES ?=
# Program settings
CC = $(AVR_TOOLS_PATH)avr-gcc
CXX = $(AVR_TOOLS_PATH)avr-g++
OBJCOPY = $(AVR_TOOLS_PATH)avr-objcopy
OBJDUMP = $(AVR_TOOLS_PATH)avr-objdump
AR = $(AVR_TOOLS_PATH)avr-ar
SIZE = $(AVR_TOOLS_PATH)avr-size
NM = $(AVR_TOOLS_PATH)avr-nm
AVRDUDE = avrdude
REMOVE = rm -f
MV = mv -f
# Tool for testing compiler flags
cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
; then echo "$(2)"; else echo "$(3)"; fi ;)
# Place -D or -U options here # Place -D or -U options here
CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)} CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
CXXDEFS = $(CDEFS) CXXDEFS = $(CDEFS)
@ -259,10 +275,12 @@ CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
endif endif
#CEXTRA = -Wa,-adhlns=$(<:.c=.lst) #CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING) CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING) \
CXXFLAGS = $(CDEFS) $(CINCS) -O$(OPT) -Wall $(CEXTRA) $(CTUNING) $(call cc-option,$(CC),-flto -fwhole-program,)
CXXFLAGS := $(CDEFS) $(CINCS) -O$(OPT) -Wall $(CEXTRA) $(CTUNING) \
$(call cc-option,$(CC),-flto -fwhole-program,)
#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs #ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
LDFLAGS = -lm LDFLAGS = -lm -Wl,--relax
# Programming support using avrdude. Settings and variables. # Programming support using avrdude. Settings and variables.
@ -272,18 +290,6 @@ AVRDUDE_FLAGS = -D -C $(ARDUINO_INSTALL_DIR)/hardware/tools/avrdude.conf \
-p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \ -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \
-b $(UPLOAD_RATE) -b $(UPLOAD_RATE)
# Program settings
CC = $(AVR_TOOLS_PATH)avr-gcc
CXX = $(AVR_TOOLS_PATH)avr-g++
OBJCOPY = $(AVR_TOOLS_PATH)avr-objcopy
OBJDUMP = $(AVR_TOOLS_PATH)avr-objdump
AR = $(AVR_TOOLS_PATH)avr-ar
SIZE = $(AVR_TOOLS_PATH)avr-size
NM = $(AVR_TOOLS_PATH)avr-nm
AVRDUDE = avrdude
REMOVE = rm -f
MV = mv -f
# Define all object files. # Define all object files.
OBJ = ${patsubst %.c, $(BUILD_DIR)/%.o, ${SRC}} OBJ = ${patsubst %.c, $(BUILD_DIR)/%.o, ${SRC}}
OBJ += ${patsubst %.cpp, $(BUILD_DIR)/%.o, ${CXXSRC}} OBJ += ${patsubst %.cpp, $(BUILD_DIR)/%.o, ${CXXSRC}}
@ -380,9 +386,13 @@ extcoff: $(TARGET).elf
$(NM) -n $< > $@ $(NM) -n $< > $@
# Link: create ELF output file from library. # Link: create ELF output file from library.
$(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h $(BUILD_DIR)/$(TARGET).elf: $(BUILD_DIR)/$(TARGET).o
$(Pecho) " CXX $@" $(Pecho) " CXX $@"
$P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections -o $@ -L. $(OBJ) $(LDFLAGS) $P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections -o $@ -L. $^ $(LDFLAGS)
$(BUILD_DIR)/$(TARGET).o: $(OBJ) Configuration.h
$(Pecho) " CXX $@"
$P $(CC) $(ALL_CXXFLAGS) -nostdlib -Wl,-r -o $@ $(OBJ)
$(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE) $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
$(Pecho) " CC $<" $(Pecho) " CC $<"

View File

@ -432,9 +432,9 @@ void manage_heater()
soft_pwm_bed = 0; soft_pwm_bed = 0;
} }
#elif not defined BED_LIMIT_SWITCHING #elif !defined(BED_LIMIT_SWITCHING)
// Check if temperature is within the correct range // Check if temperature is within the correct range
if((current_temperature_bed > BED_MAXTEMP) && (current_temperature_bed < BED_MINTEMP)) if((current_temperature_bed > BED_MINTEMP) && (current_temperature_bed < BED_MAXTEMP))
{ {
if(current_temperature_bed >= target_temperature_bed) if(current_temperature_bed >= target_temperature_bed)
{ {
@ -1042,6 +1042,7 @@ ISR(TIMER0_COMPB_vect)
#if EXTRUDERS > 2 #if EXTRUDERS > 2
current_temperature_raw[2] = raw_temp_2_value; current_temperature_raw[2] = raw_temp_2_value;
#endif #endif
current_temperature_bed_raw = raw_temp_bed_value;
} }
temp_meas_ready = true; temp_meas_ready = true;
@ -1101,9 +1102,9 @@ ISR(TIMER0_COMPB_vect)
/* No bed MINTEMP error? */ /* No bed MINTEMP error? */
#if defined(BED_MAXTEMP) && (TEMP_SENSOR_BED != 0) #if defined(BED_MAXTEMP) && (TEMP_SENSOR_BED != 0)
# if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP # if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP
if(current_temperature_bed <= bed_maxttemp_raw) { if(current_temperature_bed_raw <= bed_maxttemp_raw) {
#else #else
if(current_temperature_bed >= bed_maxttemp_raw) { if(current_temperature_bed_raw >= bed_maxttemp_raw) {
#endif #endif
target_temperature_bed = 0; target_temperature_bed = 0;
bed_max_temp_error(); bed_max_temp_error();

View File

@ -474,7 +474,7 @@ const short temptable_55[][2] PROGMEM = {
//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature //Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
#ifndef HEATER_0_RAW_HI_TEMP #ifndef HEATER_0_RAW_HI_TEMP
# if HEATER_0_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value # ifdef HEATER_0_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
# define HEATER_0_RAW_HI_TEMP 0 # define HEATER_0_RAW_HI_TEMP 0
# define HEATER_0_RAW_LO_TEMP 16383 # define HEATER_0_RAW_LO_TEMP 16383
# else //In case of an thermocouple the highest temperature results in the highest ADC value # else //In case of an thermocouple the highest temperature results in the highest ADC value
@ -497,7 +497,7 @@ const short temptable_55[][2] PROGMEM = {
//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature //Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
#ifndef HEATER_1_RAW_HI_TEMP #ifndef HEATER_1_RAW_HI_TEMP
# if HEATER_1_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value # ifdef HEATER_1_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
# define HEATER_1_RAW_HI_TEMP 0 # define HEATER_1_RAW_HI_TEMP 0
# define HEATER_1_RAW_LO_TEMP 16383 # define HEATER_1_RAW_LO_TEMP 16383
# else //In case of an thermocouple the highest temperature results in the highest ADC value # else //In case of an thermocouple the highest temperature results in the highest ADC value
@ -520,7 +520,7 @@ const short temptable_55[][2] PROGMEM = {
//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature //Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
#ifndef HEATER_2_RAW_HI_TEMP #ifndef HEATER_2_RAW_HI_TEMP
# if HEATER_2_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value # ifdef HEATER_2_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
# define HEATER_2_RAW_HI_TEMP 0 # define HEATER_2_RAW_HI_TEMP 0
# define HEATER_2_RAW_LO_TEMP 16383 # define HEATER_2_RAW_LO_TEMP 16383
# else //In case of an thermocouple the highest temperature results in the highest ADC value # else //In case of an thermocouple the highest temperature results in the highest ADC value
@ -540,7 +540,7 @@ const short temptable_55[][2] PROGMEM = {
//Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature //Set the high and low raw values for the heater, this indicates which raw value is a high or low temperature
#ifndef HEATER_BED_RAW_HI_TEMP #ifndef HEATER_BED_RAW_HI_TEMP
# if BED_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value # ifdef BED_USES_THERMISTOR //In case of a thermistor the highest temperature results in the lowest ADC value
# define HEATER_BED_RAW_HI_TEMP 0 # define HEATER_BED_RAW_HI_TEMP 0
# define HEATER_BED_RAW_LO_TEMP 16383 # define HEATER_BED_RAW_LO_TEMP 16383
# else //In case of an thermocouple the highest temperature results in the highest ADC value # else //In case of an thermocouple the highest temperature results in the highest ADC value

View File

@ -476,7 +476,7 @@ static void lcd_control_temperature_preheat_pla_settings_menu()
#if TEMP_SENSOR_BED != 0 #if TEMP_SENSOR_BED != 0
MENU_ITEM_EDIT(int3, MSG_BED, &plaPreheatHPBTemp, 0, BED_MAXTEMP - 15); MENU_ITEM_EDIT(int3, MSG_BED, &plaPreheatHPBTemp, 0, BED_MAXTEMP - 15);
#endif #endif
#if EEPROM_SETTINGS #ifdef EEPROM_SETTINGS
MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
#endif #endif
END_MENU(); END_MENU();
@ -491,7 +491,7 @@ static void lcd_control_temperature_preheat_abs_settings_menu()
#if TEMP_SENSOR_BED != 0 #if TEMP_SENSOR_BED != 0
MENU_ITEM_EDIT(int3, MSG_BED, &absPreheatHPBTemp, 0, BED_MAXTEMP - 15); MENU_ITEM_EDIT(int3, MSG_BED, &absPreheatHPBTemp, 0, BED_MAXTEMP - 15);
#endif #endif
#if EEPROM_SETTINGS #ifdef EEPROM_SETTINGS
MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings); MENU_ITEM(function, MSG_STORE_EPROM, Config_StoreSettings);
#endif #endif
END_MENU(); END_MENU();