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

LPC176x Framework SPI Fixes for MAX6675, MAX31855 and MAX31865 SPI boards #20447

Merged
merged 79 commits into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
3a9d967
First commit
GadgetAngel Dec 12, 2020
ec4032c
remove comments
GadgetAngel Dec 12, 2020
ed9418a
Generalized library calls
Dec 12, 2020
4ac3222
removed comment
Dec 13, 2020
710d7e2
used the correct case on header file
Dec 13, 2020
b7250a0
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Dec 13, 2020
4b3df50
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Dec 13, 2020
49ff321
updated lib
Dec 13, 2020
268c70b
used the correct case on header file
Dec 13, 2020
0ab9874
Add HAS_PIN_27_BOARD for CREALITY_V4 (#20446)
ellensp Dec 12, 2020
9c8ce6c
Improve ASSISTED_TRAMMING_WIZARD probe stowing (#20437)
qwewer0 Dec 12, 2020
5a7fc64
Relocate IS_MELZI define
thinkyhead Dec 13, 2020
1ba5445
Some cleanup
thinkyhead Dec 13, 2020
78cb4d2
Merge branch 'Marlin-Fix-LPC176x-SPI-Issues-bugfix' of https://github…
thinkyhead Dec 13, 2020
6c1379f
updated MAX6675 lib
Dec 13, 2020
ec0ce58
fix MAX6675 lib
Dec 13, 2020
3726ea2
removed outdated comment
Dec 13, 2020
b72aedf
Corrected the order of Parms on MAX6675 lib call
Dec 13, 2020
b5a48ed
Some cleanup
thinkyhead Dec 14, 2020
692a088
Fewer 'global' defines
thinkyhead Dec 14, 2020
ccffad1
Removed LPC1768_IS_SKRV1_3 directive
Dec 14, 2020
10d05bc
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Dec 14, 2020
0d43362
setup platformio.ini
Dec 14, 2020
87263e0
Created Compatibility Layer for MAX boards
Dec 14, 2020
6cd4133
Revert "setup platformio.ini"
Dec 14, 2020
a6ba31c
Revert "Created Compatibility Layer for MAX boards"
Dec 14, 2020
fe73c6b
Created Compatabilty layer - MAX (SPI) temp boards
Dec 14, 2020
26da0fa
disabled all code that will not be called
Dec 14, 2020
24dfbc5
cleanup
Dec 14, 2020
6d7f215
Cleanup trailing spaces
Dec 14, 2020
0663861
Cleanup
Dec 14, 2020
34dbe0a
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Dec 15, 2020
ad2efd5
fix name mismatch
Dec 15, 2020
010e1cb
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Dec 15, 2020
1cfe911
Update G28.cpp
Dec 15, 2020
bf00163
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
Dec 15, 2020
a5404d8
Revert "Update G28.cpp"
Dec 15, 2020
8aa3f89
Revert "Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bug…
Dec 15, 2020
0d930e0
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Dec 15, 2020
1e6c996
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into bugfix-2.0.x
Dec 16, 2020
039cd5e
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Dec 16, 2020
3835d99
Merge branch 'bugfix-2.0.x' into Marlin-Fix-LPC176x-SPI-Issues-bugfix
GadgetAngel Dec 16, 2020
cbf5b07
Revert "Merge branch 'bugfix-2.0.x' into Marlin-Fix-LPC176x-SPI-Issue…
GadgetAngel Dec 16, 2020
534d260
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
GadgetAngel Dec 17, 2020
232f2d5
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
GadgetAngel Dec 17, 2020
78a00df
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
GadgetAngel Dec 19, 2020
4f7e62b
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
GadgetAngel Dec 20, 2020
4457f53
Capabilities added to temperature.cpp
GadgetAngel Dec 23, 2020
bbd3ee2
cleanup
Dec 23, 2020
abd7890
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
GadgetAngel Dec 24, 2020
5af56d5
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Dec 25, 2020
a289e2e
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Dec 26, 2020
acad166
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Dec 27, 2020
84a3ebf
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Dec 28, 2020
5cbd6f2
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Dec 28, 2020
cf8f290
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Dec 30, 2020
bbcee27
I like it better the way it was before
Dec 30, 2020
f750d97
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
GadgetAngel Dec 31, 2020
cd24c6a
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
GadgetAngel Jan 1, 2021
b00aa90
Give a default value for MAX31865_MOSI_PIN
GadgetAngel Jan 1, 2021
96428a7
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/20447
thinkyhead Jan 9, 2021
0ffc8c4
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Jan 15, 2021
b604e77
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Jan 18, 2021
10eaba7
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
GadgetAngel Jan 20, 2021
bfcbd9c
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Jan 21, 2021
04d48bc
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Jan 27, 2021
c75622e
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Feb 2, 2021
ff7f423
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Feb 2, 2021
52d42d9
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Feb 5, 2021
c5c6e26
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into Marlin-Fix-…
Feb 6, 2021
6ab97cf
Various generalizations
thinkyhead Feb 6, 2021
507e28e
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/20447
thinkyhead Feb 8, 2021
2381d19
merge followup
thinkyhead Feb 8, 2021
88fa586
Update Conditionals_post.h
thinkyhead Feb 8, 2021
d99d7a8
cleanup
thinkyhead Feb 8, 2021
474fdf4
merge followup
thinkyhead Feb 8, 2021
8969cd2
ok
thinkyhead Feb 8, 2021
4ab5d68
Update temperature.cpp
thinkyhead Feb 8, 2021
925ac3e
added need st. to disable SPI TC during Startup
Feb 8, 2021
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
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LPC1768/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/**
* Detect an old pins file by checking for old ADC pins values.
*/
#define _OLD_TEMP_PIN(P) PIN_EXISTS(P) && _CAT(P,_PIN) <= 7 && _CAT(P,_PIN) != 2 && _CAT(P,_PIN) != 3
#define _OLD_TEMP_PIN(P) PIN_EXISTS(P) && _CAT(P,_PIN) <= 7 && !(_CAT(P,_PIN) >= 0 && _CAT(P,_PIN) <= 3)
#if _OLD_TEMP_PIN(TEMP_BED)
#error "TEMP_BED_PIN must be defined using the Pn_nn or Pn_nn_An format. (See the included pins files)."
#elif _OLD_TEMP_PIN(TEMP_0)
Expand Down
28 changes: 24 additions & 4 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1013,11 +1013,31 @@ void setup() {
SETUP_RUN(HAL_init());

// Init and disable SPI thermocouples
#if HEATER_0_USES_MAX6675
OUT_WRITE(MAX6675_SS_PIN, HIGH); // Disable
#if HEATER_0_USES_MAX6675 && PIN_EXISTS(MAX6675_SS)
GadgetAngel marked this conversation as resolved.
Show resolved Hide resolved
OUT_WRITE(MAX6675_SS_PIN, HIGH);
#endif
#if HEATER_1_USES_MAX6675
OUT_WRITE(MAX6675_SS2_PIN, HIGH); // Disable
#if HEATER_1_USES_MAX6675 && PIN_EXISTS(MAX6675_SS2)
OUT_WRITE(MAX6675_SS2_PIN, HIGH);
#endif
#if HEATER_0_USES_MAX6675 && PIN_EXISTS(MAX6675_CS)
GadgetAngel marked this conversation as resolved.
Show resolved Hide resolved
OUT_WRITE(MAX6675_CS_PIN, HIGH);
#endif
#if HEATER_1_USES_MAX6675 && PIN_EXISTS(MAX6675_CS2)
OUT_WRITE(MAX6675_CS2_PIN, HIGH);
#endif

#if HEATER_0_USES_MAX6675 && PIN_EXISTS(MAX31855_CS)
OUT_WRITE(MAX31855_CS_PIN, HIGH);
#endif
#if HEATER_1_USES_MAX6675 && PIN_EXISTS(MAX31855_CS2)
OUT_WRITE(MAX31855_CS2_PIN, HIGH);
#endif

#if HEATER_0_USES_MAX6675 && PIN_EXISTS(MAX31865_CS)
OUT_WRITE(MAX31865_CS_PIN, HIGH);
#endif
#if HEATER_1_USES_MAX6675 && PIN_EXISTS(MAX31865_CS2)
OUT_WRITE(MAX31865_CS2_PIN, HIGH);
#endif

#if HAS_L64XX
thinkyhead marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
2 changes: 0 additions & 2 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,5 +406,3 @@

#define _MB_1(B) (defined(BOARD_##B) && MOTHERBOARD==BOARD_##B)
#define MB(V...) DO(MB,||,V)

#define IS_MELZI MB(MELZI, MELZI_CREALITY, MELZI_MAKR3D, MELZI_MALYAN, MELZI_TRONXY, MELZI_V2)
14 changes: 14 additions & 0 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@
#define MAX6675_0_IS_MAX31865 1
#elif TEMP_SENSOR_0 == -3
#define MAX6675_0_IS_MAX31855 1
#elif TEMP_SENSOR_0 == -2
#define MAX6675_0_IS_MAX6675 1
#endif
#elif TEMP_SENSOR_0 == -4
#define HEATER_0_USES_AD8495 1
Expand Down Expand Up @@ -442,6 +444,8 @@
#define MAX6675_1_IS_MAX31865 1
#elif TEMP_SENSOR_1 == -3
#define MAX6675_1_IS_MAX31855 1
#elif TEMP_SENSOR_1 == -2
#define MAX6675_1_IS_MAX6675 1
#endif
#if TEMP_SENSOR_1 != TEMP_SENSOR_0
#if TEMP_SENSOR_1 == -5
Expand Down Expand Up @@ -469,6 +473,16 @@
#undef HEATER_1_MAXTEMP
#endif

#if MAX6675_0_IS_MAX31855 || MAX6675_1_IS_MAX31855
#define MAX6675_HAS_MAX31855 1
#endif
#if MAX6675_0_IS_MAX31865 || MAX6675_1_IS_MAX31865
#define MAX6675_HAS_MAX31865 1
#endif
#if MAX6675_0_IS_MAX6675 || MAX6675_1_IS_MAX6675
#define MAX6675_HAS_MAX6675 1
#endif

#if TEMP_SENSOR_2 == -4
#define HEATER_2_USES_AD8495 1
#elif TEMP_SENSOR_2 == -3
Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -1700,21 +1700,21 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
/**
* Pins and Sensor IDs must be set for each heater
*/
#if HEATER_0_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS)
#error "MAX6675_SS_PIN (required for TEMP_SENSOR_0) not defined for this board."
#if HEATER_0_USES_MAX6675 && !ANY_PIN(MAX6675_SS, MAX31855_CS, MAX31865_CS, MAX6675_CS)
#error "TEMP_SENSOR_0 requires a MAX6675_SS2_PIN, MAX6675_CS2_PIN, MAX31855_CS2_PIN, or MAX31865_CS2_PIN."
#elif HAS_HOTEND && !HAS_TEMP_HOTEND && !HEATER_0_DUMMY_THERMISTOR
#error "TEMP_0_PIN (required for TEMP_SENSOR_0) not defined for this board."
#elif EITHER(HAS_MULTI_HOTEND, HEATERS_PARALLEL) && !HAS_HEATER_1
#error "HEATER_1_PIN is not defined. TEMP_SENSOR_1 might not be set, or the board (not EEB / EEF?) doesn't define a pin."
#endif

#if HAS_MULTI_HOTEND
#if HEATER_1_USES_MAX6675 && !PIN_EXISTS(MAX6675_SS2)
#error "MAX6675_SS2_PIN (required for TEMP_SENSOR_1) not defined for this board."
#if HEATER_1_USES_MAX6675 && !ANY_PIN(MAX6675_SS2, MAX31855_CS2, MAX31865_CS2, MAX6675_CS2)
#error "TEMP_SENSOR_1 requires a MAX6675_SS2_PIN, MAX6675_CS2_PIN, MAX31855_CS2_PIN, or MAX31865_CS2_PIN."
#elif TEMP_SENSOR_1 == 0
#error "TEMP_SENSOR_1 is required with 2 or more HOTENDS."
#elif !ANY_PIN(TEMP_1, MAX6675_SS2) && !HEATER_1_DUMMY_THERMISTOR
#error "TEMP_1_PIN not defined for this board."
#error "TEMP_1_PIN or MAX6675_SS2_PIN not defined for this board."
#elif ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
#error "HOTENDS must be 1 with TEMP_SENSOR_1_AS_REDUNDANT."
#endif
Expand Down Expand Up @@ -1884,7 +1884,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#if !HAS_HEATER_0 && EXTRUDERS
#error "HEATER_0_PIN not defined for this board."
#elif !ANY_PIN(TEMP_0, MAX6675_SS)
#error "TEMP_0_PIN not defined for this board."
#error "TEMP_0_PIN or MAX6675_SS not defined for this board."
#elif ((defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && !PINS_EXIST(E0_STEP, E0_DIR))
#error "E0_STEP_PIN or E0_DIR_PIN not defined for this board."
#elif ( !(defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)) && (!PINS_EXIST(E0_STEP, E0_DIR) || !HAS_E0_ENABLE))
Expand Down
Loading