Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Makefile, fix/cleanup temperature.h/.cpp ubl.h #26018

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7d25d8b
relocate call for dwin.h
classicrocker883 May 19, 2023
9669ead
USE_UBL_VIEWER enabled for bedlevel_tools.h
classicrocker883 May 19, 2023
3f5bcf4
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Jun 4, 2023
436c510
Clean up
classicrocker883 Jun 4, 2023
0413abc
Cleanup
classicrocker883 Jun 4, 2023
c05b6c3
also
thinkyhead Jun 4, 2023
600f063
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Jun 15, 2023
8104331
🧿Fix CMake errors, can be used for buids
classicrocker883 Jun 15, 2023
e4ed73f
🧿Fix CMake errors, can be used for buids
classicrocker883 Jun 15, 2023
02a5f00
Merge branch 'bugfix-2.1.x-fixes' of https://github.com/classicrocker…
classicrocker883 Jun 15, 2023
6075a16
Update CMakeLists.txt
classicrocker883 Jun 15, 2023
a4d8865
Update CMakeLists.txt
classicrocker883 Jun 15, 2023
412cf58
Update CMakeLists.txt
classicrocker883 Jun 15, 2023
9e33e34
Merge branch 'bugfix-2.1.x' into pr/25983
thinkyhead Jun 16, 2023
d2f01f5
Merge branch 'bugfix-2.1.x' into pr/25983
thinkyhead Jun 17, 2023
a7fc39d
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Jun 18, 2023
7648b73
detab
thinkyhead Jun 18, 2023
e97b390
Merge branch 'bugfix-2.1.x-fixes' of https://github.com/classicrocker…
classicrocker883 Jun 26, 2023
e3fb93e
Updated Makefile
classicrocker883 Jun 26, 2023
38fe067
**temperature** Element identifiers heater_id_t
classicrocker883 Jun 26, 2023
35021a4
add user_dir
classicrocker883 Jun 27, 2023
5a9751e
add 258K support for RC chipsets
classicrocker883 Jun 27, 2023
c75b4fc
rm tilt_mesh_based_on_3pts - not found
classicrocker883 Jun 29, 2023
23ce63e
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
classicrocker883 Jun 29, 2023
b2c039e
No redundant Heater IDs
thinkyhead Jun 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions Marlin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ HARDWARE_MOTHERBOARD ?= 1020

ifeq ($(OS),Windows_NT)
# Windows
ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino
ARDUINO_USER_DIR ?= ${HOME}/Arduino
ARDUINO_INSTALL_DIR ?= ${HOME}/AppData/Local/Arduino
ARDUINO_USER_DIR ?= ${HOME}/Documents/Arduino
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
Expand All @@ -82,11 +82,11 @@ endif

# Arduino source install directory, and version number
# On most linuxes this will be /usr/share/arduino
ARDUINO_INSTALL_DIR ?= ${HOME}/Arduino
ARDUINO_VERSION ?= 106
ARDUINO_INSTALL_DIR ?= ${HOME}/AppData/Local/Arduino # C:/Users/${USERNAME}/AppData/Local/Arduino
ARDUINO_VERSION ?= 10819

# The installed Libraries are in the User folder
ARDUINO_USER_DIR ?= ${HOME}/Arduino
ARDUINO_USER_DIR ?= ${HOME}/Documents/Arduino

# You can optionally set a path to the avr-gcc tools.
# Requires a trailing slash. For example, /usr/local/avr-gcc/bin/
Expand Down Expand Up @@ -656,18 +656,18 @@ ifeq ($(HARDWARE_VARIANT), $(filter $(HARDWARE_VARIANT),arduino Teensy Sanguino)
# Old libraries (avr-core 1.6.21 < / Arduino < 1.6.8)
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI
# New libraries (avr-core >= 1.6.21 / Arduino >= 1.6.8)
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/arduino/avr/1.8.6/libraries/SPI/src
endif

ifeq ($(IS_MCU),1)
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/cores/arduino
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/arduino/avr/1.8.6/cores/arduino

# Old libraries (avr-core 1.6.21 < / Arduino < 1.6.8)
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SoftwareSerial
# New libraries (avr-core >= 1.6.21 / Arduino >= 1.6.8)
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SPI/src
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/SoftwareSerial/src
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/arduino/avr/1.8.6/libraries/SPI/src
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/arduino/avr/1.8.6/libraries/SoftwareSerial/src
endif

VPATH += $(ARDUINO_INSTALL_DIR)/libraries/LiquidCrystal/src
Expand All @@ -681,17 +681,17 @@ ifeq ($(WIRE), 1)
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/utility
# New libraries (avr-core >= 1.6.21 / Arduino >= 1.6.8)
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/src
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/libraries/Wire/src/utility
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/libraries/Wire/src/utility
endif
ifeq ($(NEOPIXEL), 1)
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/Adafruit_NeoPixel
endif
ifeq ($(U8GLIB), 1)
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/csrc
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/cppsrc
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/fntsrc
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib-HAL
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib-HAL/src
# VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib
# VPATH += $(ARDUINO_INSTALL_DIR)/libraries/U8glib/src
endif
ifeq ($(TMC), 1)
VPATH += $(ARDUINO_INSTALL_DIR)/libraries/TMCStepper/src
Expand All @@ -700,9 +700,9 @@ endif

ifeq ($(HARDWARE_VARIANT), arduino)
HARDWARE_SUB_VARIANT ?= mega
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/arduino/avr/variants/$(HARDWARE_SUB_VARIANT)
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/variants/$(HARDWARE_SUB_VARIANT)
else ifeq ($(HARDWARE_VARIANT), Sanguino)
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/marlin/avr/variants/sanguino
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/variants/sanguino
else ifeq ($(HARDWARE_VARIANT), archim)
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/libsam
VPATH += $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/system/CMSIS/CMSIS/Include/
Expand All @@ -718,7 +718,7 @@ else ifeq ($(HARDWARE_VARIANT), archim)
LDLIBS = $(ARDUINO_INSTALL_DIR)/packages/ultimachine/hardware/sam/1.6.9-b/variants/archim/libsam_sam3x8e_gcc_rel.a
else
HARDWARE_SUB_VARIANT ?= standard
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/$(HARDWARE_VARIANT)/variants/$(HARDWARE_SUB_VARIANT)
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/avr/1.8.6/variants/$(HARDWARE_SUB_VARIANT)
endif

LIB_SRC = wiring.c \
Expand All @@ -733,7 +733,7 @@ endif

ifeq ($(HARDWARE_VARIANT), Teensy)
LIB_SRC = wiring.c
VPATH += $(ARDUINO_INSTALL_DIR)/hardware/teensy/cores/teensy
VPATH += $(ARDUINO_INSTALL_DIR)/packages/arduino/hardware/teensy/cores/teensy
endif

LIB_CXXSRC = WMath.cpp WString.cpp Print.cpp SPI.cpp
Expand Down Expand Up @@ -880,7 +880,7 @@ AVRDUDE_WRITE_FLASH = -Uflash:w:$(BUILD_DIR)/$(TARGET).hex:i
ifeq ($(shell uname -s), Linux)
AVRDUDE_CONF = /etc/avrdude/avrdude.conf
else
AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf
AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf
endif
AVRDUDE_FLAGS = -D -C$(AVRDUDE_CONF) \
-p$(PROG_MCU) -P$(AVRDUDE_PORT) -c$(AVRDUDE_PROGRAMMER) \
Expand Down
1 change: 0 additions & 1 deletion Marlin/src/feature/bedlevel/ubl/ubl.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class unified_bed_leveling {
static bool G29_parse_parameters() __O0;
static void shift_mesh_height();
static void probe_entire_mesh(const xy_pos_t &near, const bool do_ubl_mesh_map, const bool stow_probe, const bool do_furthest) __O0;
static void tilt_mesh_based_on_3pts(const_float_t z1, const_float_t z2, const_float_t z3);
static void tilt_mesh_based_on_probed_grid(const bool do_ubl_mesh_map);
static bool smart_fill_one(const uint8_t x, const uint8_t y, const int8_t xdir, const int8_t ydir);
static bool smart_fill_one(const xy_uint8_t &pos, const xy_uint8_t &dir) {
Expand Down
33 changes: 17 additions & 16 deletions Marlin/src/inc/Conditionals_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,21 +306,22 @@
*/

// Temperature sensor IDs
#define HID_REDUNDANT -7
#define HID_SOC -6
#define HID_BOARD -5
#define HID_COOLER -4
#define HID_PROBE -3
#define HID_CHAMBER -2
#define HID_BED -1
#define HID_E0 0
#define HID_E1 1
#define HID_E2 2
#define HID_E3 3
#define HID_E4 4
#define HID_E5 5
#define HID_E6 6
#define HID_E7 7
#define H_NONE -128
#define H_REDUNDANT -7
#define H_SOC -6
#define H_BOARD -5
#define H_COOLER -4
#define H_PROBE -3
#define H_CHAMBER -2
#define H_BED -1
#define H_E0 0
#define H_E1 1
#define H_E2 2
#define H_E3 3
#define H_E4 4
#define H_E5 5
#define H_E6 6
#define H_E7 7

#define _SENSOR_IS(I,N) || (TEMP_SENSOR(N) == I)
#define _E_SENSOR_IS(I,N) _SENSOR_IS(N,I)
Expand All @@ -333,7 +334,7 @@
#endif

#if TEMP_SENSOR_REDUNDANT
#define _HEATER_ID(M) HID_##M
#define _HEATER_ID(M) H_##M
#define HEATER_ID(M) _HEATER_ID(M)
#define REDUNDANT_TEMP_MATCH(M,N) (HEATER_ID(TEMP_SENSOR_REDUNDANT_##M) == _HEATER_ID(N))
#else
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2944,7 +2944,7 @@ void Temperature::init() {
temp_range[NR].raw_max -= TEMPDIR(NR) * (OVERSAMPLENR); \
}while(0)

#define _MINMAX_TEST(N,M) (!TEMP_SENSOR_##N##_IS_DUMMY && HOTENDS > N && TEMP_SENSOR_##N##_IS_THERMISTOR && defined(HEATER_##N##_##M##TEMP))
#define _MINMAX_TEST(N,M) (!TEMP_SENSOR_##N##_IS_DUMMY && HOTENDS > (N) && TEMP_SENSOR_##N##_IS_THERMISTOR && defined(HEATER_##N##_##M##TEMP))

#if _MINMAX_TEST(0, MIN)
_TEMP_MIN_E(0);
Expand Down
13 changes: 1 addition & 12 deletions Marlin/src/module/temperature.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,7 @@
#define FAN_IS_M106ABLE(Q) false
#endif

// Element identifiers. Positive values are hotends. Negative values are other heaters or coolers.
typedef enum : int_fast8_t {
H_REDUNDANT = HID_REDUNDANT,
H_COOLER = HID_COOLER,
H_PROBE = HID_PROBE,
H_BOARD = HID_BOARD,
H_SOC = HID_SOC,
H_CHAMBER = HID_CHAMBER,
H_BED = HID_BED,
H_E0 = HID_E0, H_E1, H_E2, H_E3, H_E4, H_E5, H_E6, H_E7,
H_NONE = -128
} heater_id_t;
typedef int_fast8_t heater_id_t;

/**
* States for ADC reading in the ISR
Expand Down
14 changes: 14 additions & 0 deletions buildroot/share/PlatformIO/ldscripts/creality256k.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
MEMORY
{
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - 40
rom (rx) : ORIGIN = 0x08007000, LENGTH = 256K - 28K
}

/* Provide memory region aliases for common.inc */
REGION_ALIAS("REGION_TEXT", rom);
REGION_ALIAS("REGION_DATA", ram);
REGION_ALIAS("REGION_BSS", ram);
REGION_ALIAS("REGION_RODATA", rom);

/* Let common.inc handle the real work. */
INCLUDE common.inc
6 changes: 3 additions & 3 deletions ini/stm32f1-maple.ini
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ lib_deps = ${env:STM32F103RC_btt_maple.lib_deps}
USBComposite for [email protected]

#
# Creality (STM32F103RET6)
# Creality 512K (STM32F103RET6)
#
[env:STM32F103RE_creality_maple]
extends = env:STM32F103RE_maple
Expand All @@ -123,13 +123,13 @@ debug_tool = jlink
upload_protocol = jlink

#
# Creality (STM32F103RCT6)
# Creality 256K (STM32F103RCT6)
#
[env:STM32F103RC_creality_maple]
extends = env:STM32F103RC_maple
build_flags = ${env:STM32F103RC_maple.build_flags} -DTEMP_TIMER_CHAN=4
board_build.address = 0x08007000
board_build.ldscript = creality.ld
board_build.ldscript = creality256k.ld
board_build.rename = firmware-{date}-{time}.bin
debug_tool = jlink
upload_protocol = jlink
Expand Down