Commit Graph

25 Commits

Author SHA1 Message Date
Guðni Már Gilbert ec921eb53b MMU: Add enum class for register map
No change in memory
2023-08-05 10:36:00 +02:00
Guðni Már Gilbert ef4efc22c3 PFW-1528 Intercept register 0x14
This commit syncs the 8-bit firmware with the 32-bit

Change in memory:
Flash: +56 bytes
SRAM: 0 bytes
2023-07-13 08:00:11 +02:00
D.R.racer b837c11840 Disable reading MMU register 0x21
It has proven to be too unreliable and may confuse end users.
2023-03-14 14:16:41 +01:00
DRracer e787111922
Add MMU error code: MCU_UNDERVOLTAGE_VCC (#4069)
+ read bandgap voltage periodically
+ correct wording of ERR_ELECTRICAL_MCU_UNDERVOLTAGE_VCC (as requested in Prusa-Error-Codes PR#81)
2023-03-08 15:42:25 +01:00
D.R.racer 303a67cd6f Introduce MMU EEPROM reset feature
This new feature requires MMU FW v 2.1.7 (which brings some more small changes)
2023-02-24 15:26:07 +01:00
D.R.racer 0555376502 Refactor mmu2.cpp and related interfaces
The general idea is to keep platform specific implementation away from the MMU state machines as much as we can.
That would enable unit testing the top level MMU state machine and integration into other project as well (if needed).
2023-01-31 09:35:22 +01:00
D.R.racer 0a3517e8b2 Show an error screen when try-unload fails to push filament into nozzle
This is a prototype implementation of having the ability to show an MMU error screen even for printer's errors (during an MMU operation).
Also, the retry count of unloads after failed load the extruder tube is now limited to ~3 attempts.

Technically, since this very error is not an MMU's one (MMU is just fine at this stage) but a printer's one I tried to hack the existing error-reporting infrastructure to handle such a case.
The original idea of this approach was suggested by @vintagePC
2022-12-30 14:23:44 +01:00
Yuri D'Elia 5f2f6dde13 array<>::size should return constexpr expression
This allows to size buffers at compile time (matches c++11 behavior).
2022-12-16 16:21:59 +01:00
D.R.racer 10a9e0f0a0 Recover from MMU restart while performing a command
PFW-1427
2022-11-20 17:27:36 +01:00
D.R.racer 0aeb74e5b1 Intercept M708 A0xb: set ExtraLoadDistance on the printer side too 2022-10-11 15:51:01 +02:00
D.R.racer b0466ae20f Add infrastructure for MMU parametrization after comm start
For now, only the Extra loading distance is being sent, but the infrastructure can be easily extended for other registers as well.
2022-10-11 15:51:01 +02:00
D.R.racer 013ce588a5 Support reading/polling multiple registers
In Idle and Command mode it is now possible to specify a list of registers which shall be periodically read from the MMU.
To keep the code and RAM size down registers are intentionally separated into 8bit and 16bit sets.
Adding a register into the set is just a matter of parametrization, there is no need to change the state machines anymore.
2022-10-11 15:51:01 +02:00
D.R.racer 4d3a5433ad Implement read/write registers for M707/M708 2022-09-16 10:23:47 +02:00
D.R.racer 6c0d3b0b78 Optimize MMU protocol logic 2022-09-16 10:22:39 +02:00
D.R.racer 05ad1dc2f6 Refactoring of protocol logic to lower RAM consumption
Should also place the statistics request to the right spot in the state machine.
2022-09-16 10:22:39 +02:00
Guðni Már Gilbert dfddf3eaa5 Initial commit for MMU statistics 2022-09-16 10:22:39 +02:00
D.R.racer 0e036b9d8a Save some more RAM in protocol_logic 2022-09-16 10:22:38 +02:00
D.R.racer 53e2d68183 Retry up to 6x in case of incorrect MMU FW version
Because it looks like the communication drop outs are caused by some electrical issues and we can loose even a byte from the version response, which is deadly for future operation.
2022-09-16 10:22:38 +02:00
D.R.racer 14b2befb7d Switch from Start Seq into Idle immediately + disable FS autoload on MMU 2022-09-16 10:22:38 +02:00
D.R.racer fa176c69db Fix protocol error recovery
Communication timeout and Protocol Errors are now distinguished.
In case of a Protocol Error, the printer waits for heartBeatTimeout to allow filling up the input UART buffer (we expect the MMU still produces some bytes).
Once the timeout elapsed, the input UART buffer is cleared and a new Start Sequence is initiated.
2022-09-16 10:22:38 +02:00
Guðni Már Gilbert 999320f671 Limit build number to uint8_t (#49)
Currently the MMU only sends one byte so there is no need
in storing the version with two bytes
2022-09-16 10:22:38 +02:00
D.R.racer dab26fe50b Report detected MMU version in the Support menu
It was just subtly broken, all the functionality had already been implemented.
2022-09-16 10:22:38 +02:00
VintagePC f9bedc3c94 Button handling WIP 2022-09-16 10:22:38 +02:00
D.R.racer a0e9a302b8 Suppress communication drop-out < 8s (MMU in bootloader)
PFW-1327
2022-09-16 10:22:38 +02:00
D.R.racer 2e293e90a0 MMU2 interface overhaul
First port of the new MMU2-printer interface into 8bit FW.
2022-09-16 10:21:53 +02:00