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

Improve SPI TFT and XPT2046 support (HAL rework) #24911

Closed
wants to merge 100 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
94e2a5d
- improved SPI TFT and XPT2046 support (HAL handling rework based on …
quiret Oct 20, 2022
9096c4b
- fixed SPI bus support across the board, so it is possible to have T…
quiret Oct 20, 2022
39eb97b
- (temporarily?) linking to my updated TMCStepper repository to fix c…
quiret Oct 21, 2022
f9fb193
- added support for boards whose SPI pins stay anonymous/defaults
quiret Oct 21, 2022
57c0574
- added MKS TS35 V2.0 rotary encoder buttons support (the TS35-R mode…
quiret Oct 27, 2022
77ead05
- fix for TMC2660 SPI stepper driver (it is an odd-ball that does not…
quiret Oct 27, 2022
6b20c13
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
quiret Oct 28, 2022
8fea5ee
- further global SPI improvements (all platforms + many Marlin functi…
quiret Oct 28, 2022
c3f17d7
- reverting configuration changes that were not meant to be committed…
quiret Oct 28, 2022
d2d9fe5
- removed some deprecated stuff from the LPC1768 platform that made c…
quiret Oct 28, 2022
24a92fc
- fixed a typo in the HAL SPI for DUE
quiret Oct 28, 2022
6371126
- limit the Arduino DUE software SPI layer to just the standard SD ca…
quiret Oct 28, 2022
998a513
- fixed a missing preprocessor macro in the SD card reliability updat…
quiret Oct 28, 2022
1d82c37
cleanup, refer directly to "SPI"
thinkyhead Oct 30, 2022
e5ce795
Keep 'static' for DMA
thinkyhead Oct 30, 2022
9f2193d
Fix macros
thinkyhead Oct 30, 2022
94a9bca
Try success flag
thinkyhead Oct 30, 2022
979abe2
8 bit rate enum
thinkyhead Oct 30, 2022
b8345f8
- added global HAL SPI layer with STM32, ESP32 and LPC176x/LPC175x un…
quiret Nov 24, 2022
e731821
- various STM32 fixes
quiret Nov 24, 2022
1394088
- various ESP32 fixes (HAL NVIC for ARM only)
quiret Nov 24, 2022
33e68b6
Merge branch 'bugfix-2.1.x' of github.com:quiret/Marlin into bugfix-2…
quiret Nov 24, 2022
14c933b
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
quiret Nov 24, 2022
f375d4d
- adjustment for SOFTWARE_SPI & HALSPI_HW_GENERIC on STM32 (it now co…
quiret Nov 24, 2022
17dd8b0
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
quiret Nov 28, 2022
4223ef4
- reliability upgrade for ATmega2560 MCU series (640-1280-1281-2560-2…
quiret Nov 29, 2022
6cf4f5a
- added another set of AVR MCUs to the supported list for the reliabi…
quiret Nov 29, 2022
31c8e83
- added another set of supported AVR MCUs
quiret Nov 30, 2022
b8da4fb
- added another set of 8bit AVR MCUs to the reliability update compat…
quiret Nov 30, 2022
bb3f820
- added _ATmega_getPinFunctions function: returns the list of MCU fun…
quiret Dec 1, 2022
6e25b73
Merge branch 'bugfix-2.1.x' into pr/24911
thinkyhead Dec 5, 2022
54ab13c
- improved the AVR HAL SPI hardware implementation + moved SOFTWARE_S…
quiret Dec 6, 2022
d7bb6f5
- added temperature feedback in Celsius to the Serial output error me…
quiret Dec 6, 2022
e22249a
- fixed a crash in the LCD menu progress indication rotation where a …
quiret Dec 7, 2022
7446980
- added optimized HAL SPI implementation for 8bit AVR MCUs
quiret Dec 8, 2022
80aaf66
Merge branch 'bugfix-2.1.x' of github.com:quiret/Marlin into bugfix-2…
quiret Dec 8, 2022
e7569d9
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
quiret Dec 8, 2022
0787327
- converted the RAMPS AVR pin header files to pin names instead of in…
quiret Dec 8, 2022
8dcc5dd
- fixed a typo in the fastio_644.h update
quiret Dec 8, 2022
a5b0fdf
- fixed a typo in the fastio_AT90USB.h update
quiret Dec 8, 2022
eb2f8c2
- refactored the AVR system memory map, using the __AVR_DEFREG macro …
quiret Dec 10, 2022
a4098c7
- added spiSetupChipSelect function which is used to initialize the u…
quiret Dec 10, 2022
393b810
- improved the error messages about missing HAL SPI fast HW chip osci…
quiret Dec 10, 2022
65362ac
- converted RAMBo board pin header files to pin names instead of inte…
quiret Dec 10, 2022
a823366
misc. cleanup
thinkyhead Dec 10, 2022
374e71f
Merge branch 'bugfix-2.1.x' into pr/24911
thinkyhead Dec 10, 2022
fde3ce8
also
thinkyhead Dec 10, 2022
db0caf8
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
quiret Dec 10, 2022
6e88a6e
Merge branch 'bugfix-2.1.x' of github.com:quiret/Marlin into bugfix-2…
quiret Dec 10, 2022
8765a92
apply pins formatting
thinkyhead Dec 10, 2022
dd2f7ec
some formatting
thinkyhead Dec 12, 2022
b9cf1de
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into pr/24911
thinkyhead Dec 12, 2022
9b6ffe1
misc. cleanup
thinkyhead Dec 12, 2022
d0e67ef
- added board schematic links to LPC1768, LPC1769, mega, RAMPS, sangu…
quiret Dec 12, 2022
45c3116
Merge branch 'bugfix-2.1.x' of https://github.com/MarlinFirmware/Marl…
quiret Dec 12, 2022
6d9815e
Merge branch 'bugfix-2.1.x' of github.com:quiret/Marlin into bugfix-2…
quiret Dec 12, 2022
601547b
sanity-check
thinkyhead Dec 12, 2022
f2a95cd
- fixed a few bugs to the LPC175x/LPC176x HAL SPI that were introduce…
quiret Dec 12, 2022
9e858a3
Merge branch 'bugfix-2.1.x' of github.com:quiret/Marlin into bugfix-2…
quiret Dec 12, 2022
adbd7eb
- finalized the wiring of the MKS TinyBee V1.0 with MKS TS35-R V2.0 f…
quiret Dec 13, 2022
13a8a67
- bugfixes for LPC1768 (I have been fighting the compiler, like a man)
quiret Dec 15, 2022
f58a269
- QoL improvement for AVR users: if the TMC SPI MISO,MOSI,SCK pins ar…
quiret Dec 17, 2022
1942dbb
- added MKS TinyBee V1.0 board definition file + linked it with the b…
quiret Jan 30, 2023
3164067
- removed some unnecessary details of the Eir SDK headers
quiret Jan 30, 2023
ca90f62
- fixes for ATmega1284p building regarding build-flags taking from co…
quiret Jan 30, 2023
959fc3c
- upgraded the compiler for LPC1768/LPC1769 to newer GCC version
quiret Jan 30, 2023
6b8b918
- fixed a bug in LPC176x SPI where LSBFIRST communication could reque…
quiret Jan 30, 2023
266bd1d
- merging Marlin official into the codebase, still have to get things…
quiret Jan 31, 2023
31fb42d
- abstracted away from HAL_SPI_SUPPORTS_ASYNC to TFT_SUPPORTS_ASYNC i…
quiret Jan 31, 2023
a1720db
- follow-up due to unsaved changes in vscode (forgot to click Save All)
quiret Jan 31, 2023
e9c3932
- updated the stm32 build scripts, making stm32f1 (non-maple) build u…
quiret Jan 31, 2023
afacc43
- added smart source file selection feature to the Marlin FW build sy…
quiret Feb 1, 2023
2aad8bc
- improved the smart build system inclusion implementation, doing a f…
quiret Feb 1, 2023
7ddc37e
- followup bugfix in the python script: forgot to make the src_filter…
quiret Feb 1, 2023
d7d4ca5
- fixed some build issues (WQ25xx flash, TFT_FSMC, TCT, HAL_NVIC for …
quiret Feb 1, 2023
f36ffc8
- fixed building with LTDC TFT configuration (STM32H7xx)
quiret Feb 1, 2023
c71d445
AFFIRMATIVE COMMIT
quiret Feb 1, 2023
1b89c83
- fixed building with no TFT_FONT in global preprocessor variables (a…
quiret Feb 1, 2023
23335b0
- resolved a build issue with feature HAS_MOTOR_CURRENT_I2C and HAS_M…
quiret Feb 1, 2023
d3bbf02
- fix typo ui_api.cpp
quiret Feb 1, 2023
9500762
- updated toolchains to newer compilers, aiming for a good Marlin FW …
quiret Feb 1, 2023
08704ea
- fix ESP32 ADC for new toolchain version
quiret Feb 1, 2023
e87f26d
- fix a duplicate inline bug (not allowed anymore under the new stand…
quiret Feb 1, 2023
62ebd6e
- fixed FSMC display support: force SRAM HAL module to compile for th…
quiret Feb 1, 2023
47f8064
- (temporarily) updated the ESP3DLib dependency for MKS TinyBee / ESP…
quiret Feb 2, 2023
99f3ffb
- remove obsolete and problematic ESP32 build fixes, allowing Linux b…
quiret Feb 2, 2023
05f8c2b
- another bugfix related to a programming error in framework-arduinoe…
quiret Feb 2, 2023
af10a81
- config fixes + cleanup
quiret Feb 2, 2023
95b1a5a
- fix for STM32F103CB_malyan build target
quiret Feb 2, 2023
3592c1f
- fixed building for STM32 flash-drive mix-in enabled board configura…
quiret Feb 2, 2023
d2f6061
- compatibility update: fixed PINS_DEBUGGING build configurations by …
quiret Feb 2, 2023
12ecb3e
- follow-up fix: old STM32 toolchains need the NUM_ANALOG_FIRST but i…
quiret Feb 2, 2023
bbdfd6d
- bugfix: template specification for constructor is invalid C++ synta…
quiret Feb 2, 2023
ea8ec36
- upbringing with bugfix-2.1.x-tcupdate branch
quiret Feb 2, 2023
8fc58e3
Merge remote-tracking branch 'remotes/origin/bugfix-2.1.x-tcupdate' i…
quiret Feb 2, 2023
a603ce2
- aligning the code with the sdcard reliability PR
quiret Feb 6, 2023
d576b48
- various fixes & adjustments across Marlin
quiret Feb 15, 2023
5334ced
short yt links, delete [ \t]+$
thinkyhead Feb 20, 2023
78ac981
tweak formatting
thinkyhead Feb 20, 2023
593f1de
Merge branch 'bugfix-2.1.x' into pr/24911
thinkyhead Feb 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -2978,9 +2978,9 @@
* but you can override or define them here.
*/
//#define TMC_USE_SW_SPI
//#define TMC_SW_MOSI -1
//#define TMC_SW_MISO -1
//#define TMC_SW_SCK -1
//#define TMC_SPI_MOSI -1
//#define TMC_SPI_MISO -1
//#define TMC_SPI_SCK -1

// @section tmc/serial

Expand Down
2 changes: 1 addition & 1 deletion Marlin/Marlin.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Configuration
- https://github.com/MarlinFirmware/Configurations
Example configurations for several printer models.

- https://www.youtube.com/watch?v=3gwWVFtdg-4
- https://youtu.be/3gwWVFtdg-4
A good 20-minute overview of Marlin configuration by Tom Sanladerer.
(Applies to Marlin 1.0.x, so Jerk and Acceleration should be halved.)
Also... https://www.google.com/search?tbs=vid%3A1&q=configure+marlin
Expand Down
25 changes: 25 additions & 0 deletions Marlin/src/HAL/AVR/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ void save_reset_reason() {
wdt_disable();
}

#include "registers.h"

MarlinHAL::MarlinHAL() {
TERN_(HAL_AVR_DIRTY_INIT, _ATmega_resetperipherals()); // Clean-wipe the device state.
}

void MarlinHAL::init() {
// Init Servo Pins
#define INIT_SERVO(N) OUT_WRITE(SERVO##N##_PIN, LOW)
Expand All @@ -78,6 +84,25 @@ void MarlinHAL::init() {
#endif

init_pwm_timers(); // Init user timers to default frequency - 1000HZ

#if defined(BEEPER_PIN) || ENABLED(ATMEGA_NO_BEEPFIX)
// Make sure no alternative is locked onto the BEEPER.
// This fixes the issue where the ATmega is constantly beeping.
// Might destroy other peripherals using the pin; to circumvent that please undefine one of the above things!
// The true culprit is the AVR ArduinoCore that enables peripherals redundantly.
// (USART1 on the GeeeTech GT2560)
_ATmega_savePinAlternate(BEEPER_PIN);

OUT_WRITE(BEEPER_PIN, LOW);
#endif

// EXAMPLE: beep loop using proper pin state.
#if 0 && defined(BEEPER_PIN)
while (true) {
OUT_WRITE(BEEPER_PIN, HIGH); delay(1000);
OUT_WRITE(BEEPER_PIN, LOW); delay(2000);
}
#endif
}

void MarlinHAL::reboot() {
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/AVR/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class MarlinHAL {
public:

// Earliest possible init, before setup()
MarlinHAL() {}
MarlinHAL();

// Watchdog
static void watchdog_init() IF_DISABLED(USE_WATCHDOG, {});
Expand Down
254 changes: 0 additions & 254 deletions Marlin/src/HAL/AVR/HAL_SPI.cpp

This file was deleted.

Loading