aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* sched: Fix scheduling bug in repeat scheduler checkKevin O'Connor2021-11-061-0/+2
| | | | | | | | | Commit 7d95a004 introduced a defect - if the cached timer pointed to by last_insert did not reschedule itself then the cache would not be in a valid state and other active timers may not get properly rescheduled. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Move min_next_time check to stepper_event_full()Kevin O'Connor2021-11-041-16/+14
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Add support for stepping on both edges of a step pulseKevin O'Connor2021-11-047-7/+50
| | | | | | | | | | Add an optimized step function for drivers that support stepping on both rising and falling edges of the step pin. Enable this optimization on 32bit ARM micro-controllers. Automatically detect this capability in the host code and enable on TMC drivers running in SPI/UART mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Make step pulse duration customizable at run-timeKevin O'Connor2021-11-043-91/+47
| | | | | | | | | | | | Remove the STEP_DELAY Kconfig option and replace it with a per-stepper step_pulse_duration printer.cfg config option. The AVR code will continue to have optimized code to step and "unstep" in the same function (which is automatically activated when the step delay is 40 ticks or less). This change removes the Kconfig option for single function step/unstep on 32bit processors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* linux: Use Unix signals to notify when a timer is pendingKevin O'Connor2021-11-025-57/+105
| | | | | | | Use Unix signals in software timer implementation. This makes the code a little more efficient. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Remove gcc -mfpu=fpv4-sp-d16 floating point optionKevin O'Connor2021-10-301-1/+0
| | | | | | | | The floating point unit must be enabled in order to use it and Klipper does not currently implement that. Newer versions of gcc may spill registers to the floating point unit causing failures. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Remove gcc -mfpu=fpv4-sp-d16 floating point optionKevin O'Connor2021-10-301-1/+0
| | | | | | | | The floating point unit must be enabled in order to use it and Klipper does not currently implement that. Newer versions of gcc may spill registers to the floating point unit causing failures. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Remove gcc -mfpu=fpv4-sp-d16 floating point optionKevin O'Connor2021-10-301-1/+0
| | | | | | | | The floating point unit must be enabled in order to use it and Klipper does not currently implement that. Newer versions of gcc may spill registers to the floating point unit causing failures. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Remove unused SF_LAST_RESET flagKevin O'Connor2021-10-271-3/+2
| | | | | | | Tracking of the last reset is no longer needed after commit 8f76e53c. Remove the code tracking that status and remove the flag definition. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Add repeat reschedule optimizationKevin O'Connor2021-10-271-9/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Place common global variables into a structKevin O'Connor2021-10-271-37/+39
| | | | | | | Some architectures do better if the global variables accessed from the timer dispatch code are in a struct. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Add barrier() around all memcpy() calls in usbserial.cKevin O'Connor2021-10-271-0/+5
| | | | | | | Make sure gcc doesn't reorder any of the memcpy() calls to the usb data ram. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: add barrier in usb_read_ep0_setupLasse Dalegaard2021-10-271-0/+1
| | | | | | | | | | | | | | Some versions of gcc, in some cases, decide that it is OK to move the read to `INTR` to right after clearing the `SETUP_REC` bit of `SIE_STATUS`, instead of after the `memcpy`. The rp2040 datasheet doesn't appear to say anything about how quickly the `SETUP_REC` bit will be cleared in `INTR`, but regardless the compiler should not be re-ordering the read like this. Here we force the correct ordering using a memory barrier. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
* command: Make command_add_frame() and command_encodef() staticKevin O'Connor2021-10-212-5/+2
| | | | | | | The only users of these two functions are in command.c so they can be declared local to that code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pru: Perform message encoding on pru0 to free space on pru1Kevin O'Connor2021-10-213-37/+66
| | | | | | | | Copy the parameters of calls to console_sendf() on pru1 to pru0 and then call that function on pru0. Although copying the parameters is a "hack", the code size reduction is notable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add a MACH_STM32F0x2 alias for F042 and F072 chipsKevin O'Connor2021-10-132-7/+11
| | | | | | | | The F042 and F072 chips are in the same series and the code should be nearly identical for these chips. Implement the alias and enable USB for the F072 chips. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Rework HAVE_GPIO_HARD_PWM in KconfigKevin O'Connor2021-10-131-7/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Change stm32f0 OSPEEDR to "medium" speedKevin O'Connor2021-10-121-1/+1
| | | | | | | | | The previous OSPEEDR value of 0x2 was copied from the stm32f4.c code, but the stm32f0 interprets that value the same as 0x0 - which is "low" speed. Change the OSPEEDR value to "medium" speed so that it matches the configuration of stm32f1 chips. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add comments to configuration of OSPEEDR gpio speedKevin O'Connor2021-10-124-8/+15
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Rework #if pin definition clauses in hard_pwm.cKevin O'Connor2021-10-111-54/+50
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Adding Hardware PWM support for the STM32F4 processors (#4693)jrhelbert2021-10-112-1/+67
| | | | | This change has been expanded to include all STM32F4 processors, since they share a common TIMER mapping with some processors just not having all of the timers and pins. Signed-off-by: Jerome Helbert <jerome@helbert.net>
* config: Anycubic Vyper (#4740)Manuel Fichtner2021-10-111-1/+1
| | | | | | | | | | | This commit contains a configuration for the Anycubic Vyper printer from 2021. It uses a clone of the STM32F103 chip named GD32F103. There are 2 Mainboard versions out there v0.0.5 and v0.0.6, this config has been tested with the v0.0.6 only. It should probably work for v0.0.5 as well since there are no different changes in the Anycubic Marlin firmware. The LCD is not supported yet (might work, but didn't try yet). Signed-off-by: Marc Neuhaus <marc@neuhaus.nrw> Signed-off-by: Manuel Fichtner <manuel.fichtner@me.com>
* atsamd: Add i2c_read() implementationSimon Kühling2021-10-061-1/+43
| | | | Signed-off-by: Simon Kühling <mail@simonkuehling.de>
* stm32: Add an MACH_STM32F4x5 alias for F405, F407, and F429 chipsKevin O'Connor2021-10-063-15/+18
| | | | | | | | | The F405, F407, and F429 chips are in the same series and almost all code definitions should apply to all chips in that series. Implement the alias and fix defintions in adc.c and Kconfig that were only applying to a subset of that series. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add hardware pwm for stm32h7D4SK2021-10-062-1/+49
| | | | | Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add initial support for stm32h7D4SK2021-10-067-2/+583
| | | | | Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armc_boot: Support cortex-m7 chipsD4SK2021-10-061-0/+5
| | | | | Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_irq: Support cortex-m7 chipsD4SK2021-10-061-1/+6
| | | | | Signed-off-by: Konstantin Vogel <konstantin.vogel@gmx.net> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* linux: Support spidev4 through spidev7Kevin O'Connor2021-09-151-0/+4
| | | | | | The rpi4 has additional spi devices. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* adxl345: Compress each sample from 6 bytes to 5 bytesKevin O'Connor2021-08-301-5/+25
| | | | | | | Transmit data from mcu to host using 5 bytes per sample and up to 10 samples per message block. This improves bandwidth efficiency. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* adxl345: Implement timing via new adxl345_status messagesKevin O'Connor2021-08-301-19/+43
| | | | | | | | Query the adxl345 message counter every 100ms so that accurate timing can be obtained during measurements. This allows the adxl345 data to be exported with timestamps while captures are running. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Increase USB transmit sizeKevin O'Connor2021-08-301-1/+1
| | | | | | | Increase the transmit buffer size to better support bulk transmission of sensor data. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Fix wrong inital value at PWM setupMichael Kurz2021-08-231-8/+7
| | | | | | | | | | | This fixes a PWM going to full scale output when a initial value != 0 was given. The output was on 100% until another update occurred. This change enables the PWM counter before setting the channel values. Fixes KevinOConnor/klipper#4559 Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
* avr: Fix typo causing broken gpio mappingsKevin O'Connor2021-08-151-2/+2
| | | | | | | Commit 070fac07 had a typo causing two PINE definitions to be added to the list of available GPIOs. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Define PORTE on atmega328pKevin O'Connor2021-08-142-1/+7
| | | | | | | | The atmega328pb supports PORTE, but the current avr-libc toolchain doesn't support the atmega328pb. So, for now, add support for PORTE to atmega328p. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Rename the analog-only PE0/PE1 pins on atmega168/328 to PE2/PE3Kevin O'Connor2021-08-141-2/+2
| | | | | | | The atmega328pb has officially named these pins as PE2 and PE3, so use that naming scheme instead of the previous Klipper invented names. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Support PB7/PB6 for USART1 on stm32f0Kevin O'Connor2021-08-012-10/+17
| | | | | | | | | | | Add support for USART1 on PB7/PB6. Remove STM32_SERIAL_USART1_ALT_PA15_PA14 option and allow all serial mappings to be used on stm32f031. Reported by @Desuuuu. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add 16KiB bootloader option for STM32F103 (#4493)Simon Hawkenson2021-07-151-1/+1
| | | | | The Eryone ER-20 is a STM32F103 based 3D printer which ships with a 16KiB bootloader. Their official version of Marlin starts at 0x08004000. Signed-off-by: Simon Hawkenson <simon@hawkenson.ca>
* rp2040: implement SPILasse Dalegaard2021-07-154-0/+121
| | | | | | | This implements SPI for the rp2040 target. All output groupings of both SPI blocks are available for use. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
* rp2040: hardware PWM supportLasse Dalegaard2021-07-094-0/+111
| | | | | | | | | | This implements hardware PWM support for the rp2040. The maximum value(100% duty) is set to 255 to match the other controllers. Cycle time is clamped automatically, and uses the full 8.4 fractional range of the rp2040 PWM block. This allows a maximum PWM frequency of 490kHz and a minimum frequency of 1915 Hz. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
* stm32: Allow STM32F401 boards to use STM32 HID Bootloader (#4461)Henky Prayoga2021-07-091-2/+2
| | | Signed-off-by: Henky Prayoga <henky.prayoga@callysta-engineering.com>
* rp2040: Add _ramfunc macro to internal.h and use in bootrom.c and chipid.cKevin O'Connor2021-07-043-9/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: add chipid supportLasse Dalegaard2021-07-045-4/+171
| | | | | | | | | | The rp2040 doesn't have a chip ID, but the flash chip connected does. We can get this ID by asking the flash chip directly, but doing so requires disengaging the XIP layer, performing the interrogation of the flash chip, and then re-enabling the XIP layer. This gives us a 64-bit unique ID that we can use as our USB serial number. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
* rp2040: support usb_request_bootloaderLasse Dalegaard2021-07-044-2/+30
| | | | | Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: remove unused linker optionLasse Dalegaard2021-07-041-1/+1
| | | | | | | | | In binutils 2.36 and above the -nostartfiles option is no longer ignored. -nostartfiles is actually a gcc option, and so isn't supported by ld. Earlier versions of binutils however had less error checking, and thus just ignored the option. Signed-off-by: Lasse Dalegaard <dalegaard@gmail.com>
* rp2040: Initial USB supportKevin O'Connor2021-07-044-1/+241
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Add initial adc supportKevin O'Connor2021-07-045-2/+105
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Add initial support for the rp2040 mcuKevin O'Connor2021-07-0410-0/+640
| | | | | | | Support the rp2040 (as tested on a Raspberry Pi Pico board). This adds basic uart, timer, gpio, and watchdog support. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lcd_st7920: Check CONFIG_MACH_AVR for slow mcusKevin O'Connor2021-07-042-4/+4
| | | | | | | Use CONFIG_MACH_AVR instead of CONFIG_CLOCK_FREQ to check for slow mcus. Some fast MCUs do not export a high clock frequency. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Allow CONFIG_HAVE_GPIO_BITBANGING when not CONFIG_HAVE_GPIO_SPIKevin O'Connor2021-07-041-2/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>