mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-17 19:57:57 -06:00
pru: Support config_reset command to manually reset mcu
Add support for resetting the MCU via a software only mechanism. This is useful on the PRU. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
7b7f57e01c
commit
7083a33ecd
6 changed files with 52 additions and 12 deletions
|
@ -215,6 +215,25 @@ command_finalize_config(uint32_t *args)
|
|||
}
|
||||
DECL_COMMAND(command_finalize_config, "finalize_config crc=%u");
|
||||
|
||||
// Attempt a full manual reset of the config
|
||||
void
|
||||
config_reset(uint32_t *args)
|
||||
{
|
||||
if (! sched_is_shutdown())
|
||||
shutdown("config_reset only available when shutdown");
|
||||
irq_disable();
|
||||
config_crc = 0;
|
||||
oid_count = 0;
|
||||
oids = NULL;
|
||||
move_free_list = NULL;
|
||||
move_list = NULL;
|
||||
move_count = move_item_size = 0;
|
||||
alloc_init();
|
||||
sched_timer_reset();
|
||||
sched_clear_shutdown();
|
||||
irq_enable();
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* Timing and load stats
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue