Make it clear that the name of the constant being defined is a string.
When the value being defined is also a string, use a new
DECL_CONSTANT_STR() macro.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
If the stepper is stopped by the endstop code, then ignore any further
stepper moves until a reset_step_clock command is received.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Default to running dfu-util via sudo as most machines will not have
the user setup with permissions to access the raw usb device.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add support for entering the "stm32duino" bootloader via the arduino
1200 baud USB request. Add supprot for flashing over USB via the
"make flash" command.
Rename the existing "make flash" command to "make serialflash".
Default to using a bootloader in Kconfig.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
It's rare to use all of a target's prerequisites in a recipe - replace
most cases with $< (the target's first prerequisite).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Commit e18501d0 broke the build for targets that added objects to
klipper.elf via adding dependencies. Rework the build so that it is
possible to add objects to klipper.elf via a new OBJS_klipper.elf
makefile variable.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Some of the samd21 chips have limited memory - change the code to
reduce the size of global variables.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Use a local linker script instead of the linker script provided by
Atmel. This will allow Klipper to use dynamic memory allocation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Most samd boards have the crystal and it does improve the clock
accuracy, so default to enabling it.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add support for using the internal clocks (with USB clock recovery
mode if available) on the SAMD21. Don't use the internal clock if the
external crystal is requested (instead use the PLL synced to the
external 32Khz signal).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Add support for USB clock recovery mode if an external 32Khz crystal
is not in use. If using an external crystal, then don't use the
internal 48Mhz DFLL48Mhz clock (just use the PLLs synced to the
external 32Khz signal).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The SAMD51 ADC is only clocked on rising edges (vs both rising and
falling edges on the SAMD21) and it has a greater minimum frequency
than the SAMD21. So, increase the ADC clock.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
The cpu is almost always 16Mhz and the serial port is almost always
UART0, so no need to prompt in the normal case.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Now that the internal DWT timer is used for software timers, there is
no need to clock the peripherals at a higher clock speed. Clock all
peripherals at 48Mhz and simplify the clock generation code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Clearing the watchdog while it is in progress can cause bus stalls on
the SAMD21. It appears that clearing the watchdog on the SAMD51 can
cause lockups of the watchdog device.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>