[2.0.x] Migrate Marlin to a new TMC library#11943
[2.0.x] Migrate Marlin to a new TMC library#11943thinkyhead merged 5 commits intoMarlinFirmware:bugfix-2.0.xfrom
Conversation
True. That enum was designed only for direct addressing of the directional axes — indexing into the |
a44f6f7 to
374e12d
Compare
|
Did you see teemuatlut#25 ? It's just a merge of I'm available to help if you want to get this rebased, squashed, and passing Travis CI quickly. |
|
I can keep doing the rebases, but it also needed some additional changes than just a rebase. Right now there's also some build issue with LPC that I don't know how to explain as it builds just fine locally. |
|
Enable |
47b30ca to
cbea2a5
Compare
|
All good now. I'll clean this up today and go trough it once more. |
cbea2a5 to
7184b33
Compare
|
@thinkyhead Let me know what you think about using structs in TMC EEPROM functionality. It makes things a bit cleaner and we can then remove the TMC_AxisEnum. |
|
I like the use of structs. The one thing we can do to improve it is to use C++11-style initializers. I’ll try that out and see if it makes the code any neater or smaller. |
|
We can look closer to see why |
|
No it wasn't anything like that. EDIT: To clarify, this was a memory consumption difference in my new implementation that I was seeing. I think I also saw a reduction in sram use from what we had before when switching to structs, but I can't explain that either. But perhaps this behavior is not reproducible anymore either. I'll take a closer look at memory use tomorrow but there shouldn't be any added globals or statics. |
7184b33 to
2476e3d
Compare
|
I've submitted PR teemuatlut#26 with some minor tweaks. |
|
I looked through it and I'll merge later today. Do you mind if I split the EEPROM changes to TMC related and others? |
|
Reorganize your commits in whatever way works best for you. |
9bbeef8 to
2c530dd
Compare
2c530dd to
0d96d4f
Compare
|
The basics at least seem to working alright. I'd consider this to be a pretty big change for the TMC support so I wouldn't be surprised if there are issues but lets see how it goes. |
|
Should this be merged for testing, or do you want to fill out more of the checklist in the OP? |
|
I'll save the rest for future PRs. |
Replaces #11792 and 11919
I'll rebase and sort the added commits once they've been reviewed.
I'm starting the process to migrate to a new TMC library that aims to support more driver models.
It might be a bit early but I'd like to get a review going to make things go smoothly.
Here's a general plan for the rest of the year. Ticked boxes mark the changes introduced in this PR.
M122with fetching raw register dataSOFTWARE_ENABLEfor all smart drivers (Request from Panucatt)Regarding this PR.
A more universal library allows me to support more chips without creating a completely new library for each and every one of them. The maintenance would quickly become too great when the number of supported models is more than a couple.
The current aim is to support TMC2130, TMC2208, TMC2224, TMC5130, TMC5160 and TMC2660.
The library itself should be in pretty good condition but as always, it is mostly untested at this point.
Implementing a child class within Marlin allows us to attach certain functions to the stepper objects so they don't have to be passed around as parameters, or be tracked as indexes to an array. This PR primarily uses this for printing out the axis labels and otpw counter values.
Basically this PR forms the base for many of the new features, functions and fixes.
I ask that the PRs don't get squashed together as I've tried to organize the commits thematically and it'll make it easier to debug in case of any issues.