Move command handlers from canboot_main.c to flashcmd.c. Move startup
code to sched.c. Rename remaining bootloader entry code to new
bootentry.c file.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Convert the "complete" command to use a regular task instead of custom
code in enter_bootloader().
Perform the reboot based on a timer so that it is not necessary to
query the low-level code for ack transmission status.
Use jump_to_application() instead of canbus_reboot() to start the user
code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add the sched.c code and associated DECL_INIT(), DECL_TASK() macros so
that it is easier to import low-level Klipper code into the CanBoot
repo.
These additional code wrappers do not increase the overall binary size
as gcc does a good job of inlining the wrappers and removing unused
code during the compile process.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's a good idea to reset the cpu before starting the main application
code. However it is difficult to reliably reset the cpu in software.
This changes the software to actually do a cpu hardware reset prior to
launching the main application - after each bootup the code checks to
see if the application should be started before entering the main
bootloader code. This helps ensure the application code is started in
a "pristine" cpu state.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Bring in the latest changes from Klipper. The STM32F4 variants are
still unsupported at this time.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>