Commit Graph

37 Commits (5d8fa524fb946f068de4f793cee43d2af88fe8d7)

Author SHA1 Message Date
D.R.racer 5d8fa524fb Registers: drop support for direct R/W memory. Use R/W functions instead. Saves 56B 2025-12-01 10:48:28 +01:00
Guðni Már Gilbert b8ed9abc7f registers: fix unit of acceleration values
When reading or setting the value, the driver is expecting steps_t which is a axis scaled value.

This increases the memory footprint quite a bit. But now if you set 800mm/s2, you should get a similar value back.

Flash: +132 bytes
SRAM: 0 bytes
2025-10-30 07:43:35 +01:00
gudnimg e28ab28824 registers: support writing axis acceleration value
The read operation now returns the actual used value instead of the maximum allowed acceleration value.

Change in memory:
Flash: + 78 bytes
SRAM: 0 bytes
2025-10-30 07:43:35 +01:00
Guðni Már Gilbert 0eeef4cafd registers: remove obsolete comment
The registers were moved into program memory in FW 3.0.1

See for reference the relevant pull request:
https://github.com/prusa3d/Prusa-Firmware-MMU/pull/287
2024-12-25 10:25:00 +00:00
D.R.racer 19a0cd3ebb Add cutLength register (0x23) 2023-11-03 14:19:27 +01:00
D.R.racer fbda9faa2a Set maximum bowden length to 1m 2023-08-10 16:08:07 +02:00
D.R.racer 11d205484b Update bowden length register documentation 2023-08-10 16:08:07 +02:00
D.R.racer 19aa7ce2c7 Fixup sizeof register array after rebase 2023-08-10 16:08:07 +02:00
D.R.racer 3a105cab4a Introduce bowden length RW register (no runtime autotune)
contains updated unit tests
2023-08-10 16:08:07 +02:00
D.R.racer 77a8788821 Refactor registers a bit to make unit tests work again 2023-08-10 08:11:52 +02:00
D.R.racer 93a344bde8 Push the compiler into the optimization
It looks like copying the RegisterRec into a local variable (as it has been here before)
seems to confuse the compiler which then refuses to optimize the calls.
With this simple tweak the code is actually 8B shorter than before (while retaining the saved ~170B of RAM)
2023-08-10 08:11:52 +02:00
Guðni Már Gilbert 96985c1502 Fix unit test build
GCC 12 doesn't know AVR pgm_read_ptr()
2023-08-10 08:11:52 +02:00
Guðni Már Gilbert 1661132819 Move MMU registers into PROGMEM
Change in memory:
Flash: +34 bytes
SRAM: -170 bytes
2023-08-10 08:11:52 +02:00
3d-gussner 6532a435d2 Update doxygen pulley values 2023-05-05 10:40:51 +02:00
D.R.racer 113f71330e Disable register 0x21 2023-03-14 18:14:26 +01:00
D.R.racer 98ef2368a0 Rename CurrentVCC->CurrentBandgapVoltage
and tune surrounding comments
2023-03-08 15:14:36 +01:00
D.R.racer 314233b37f Add runtime VCC measurement as register
- extract logic of undervoltage handling into main.cpp
- fix unit tests
- bump version to 2.1.9 (new register)
2023-03-08 15:14:36 +01:00
D.R.racer 9b43b61939 Idler+Selector homing speeds: writeable registers 2023-03-02 19:54:50 +01:00
D.R.racer 88a489e3cb Add runtime iHold <= iRun check
+ refactor TMC register compilation (saves 26B)
+ update currents registers range documentation
+ update currents even in MovableBase::InitMovementNoReinitAxis
2022-12-29 11:27:34 +01:00
D.R.racer 0bca66aeb5 Allow runtime config/register motor/axis iRun current
This commit introduces a new set of registers 0x1e, 0x1f and 0x20 which allow reading and writing iRun current values for each axis/motor.
Please note the register contains raw TMC2130 iRun value which needs to be translated into mA to be understandable by people.
Translation table of iRun -> mA is present in tmc2130.cpp for now.
2022-12-29 11:27:34 +01:00
D.R.racer a52f833223 Fix and tune CutFilament + unit tests
Several issues addressed in this PR:
- CutFilament tuning + error recovery
- introduce register 0x1d (cut filament selector iRun current level)
- optimize setting iRun and iHold currents in the FW
- CutFilament unit test fixed
2022-12-28 12:15:47 +01:00
Alex Voinea dd7042e567 Fix typo 2022-09-22 12:16:41 +02:00
D.R.racer 0fa8a3c278 Refactor original solution from @leptun
- rename stall*guard to StallGuard (match name with the vendor)
- separate TMC2130 module from EEPROM (they do not need to know about each other at all)
- separate SGTHRS settings from motion - moved to globals like all other "global" parameters
- improved EEPROM storage for SGTHRS
2022-09-22 12:16:41 +02:00
Alex Voinea d5249f99fd Configurable SGTHRS 2022-09-22 12:16:41 +02:00
3d-gussner 860b91e42b Add Write gcode M708
Fix doxygen format
2022-09-09 16:57:04 +02:00
3d-gussner 5accb05b2d Fix and add units 2022-09-09 16:57:04 +02:00
3d-gussner 9c751d592d Update register documentation 2022-09-09 16:57:04 +02:00
D.R.racer 210bd99eaa Implement Idler moves via registers 2022-09-08 11:51:59 +02:00
D.R.racer 10514380a4 Change layout of registers - avoid empty registers 2022-08-16 10:35:31 +02:00
D.R.racer 74160c6c81 Remove PROGMEM temporarily - make registers actually work on AVR
This needs some investigation if it is really possible to push the Registers into PROGMEM. I think it should be possible, but the compiler is currently not collaborating.
It is not critical though as we have lots of free RAM at the moment (I can't believe I wrote this on an AVR project :) )
2022-08-11 10:26:42 +02:00
VintagePC fc5e8a6ae0 Make CMake the source of truth for versioning 2022-08-11 10:26:42 +02:00
D.R.racer 283403306e Add additional registers
It looks like the units' conversion linked some floating point routines ... C++ units are a PITA :(
2022-08-11 10:26:42 +02:00
D.R.racer 8473e84f89 Fixup CppCheck complaints 2022-08-11 10:26:42 +02:00
D.R.racer 94d6795252 Add register for FSensorToNozzleFeedrate 2022-08-11 10:26:42 +02:00
D.R.racer 7bc9217cd7 Move register map into PROGMEM
hopefully the compiler understands...
2022-08-11 10:26:42 +02:00
D.R.racer 48dacd57bd Improve code style (constexpr + unions = avoid reinterpret_cast) 2022-08-11 10:26:42 +02:00
D.R.racer a0bff0ef3a Introduce register map + use Read/Write register 2022-08-11 10:26:42 +02:00