aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Kconfig: Note which chips require software divide operationsKevin O'Connor2025-04-174-0/+8
| | | | | | | Add a new HAVE_SOFTWARE_DIVIDE_REQUIRED that indicates which chips require software divide. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* neopixel: Make sure nsecs_to_ticks() is always inlinedKevin O'Connor2025-04-171-1/+1
| | | | | | It is a compile-time calculation that needs to be inlined to work. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lcd_st7920: Make sure nsecs_to_ticks() is always inlinedKevin O'Connor2025-04-171-6/+6
| | | | | | It is a compile-time calculation that needs to be inlined to work. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lcd_hd44780: Make sure nsecs_to_ticks() is always inlinedKevin O'Connor2025-04-171-6/+6
| | | | | | It is a compile-time calculation that needs to be inlined to work. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Change hard_pwm.c MAX_PWM to 257Kevin O'Connor2025-04-172-3/+4
| | | | | | Choose a value for MAX_PWM that avoids an expensive run-time division. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix prescaler overflow check in hard_pwm.cKevin O'Connor2025-04-171-3/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2c_software: pass pulse ticks from hostTimofey Titovets2025-04-171-12/+5
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2c_software: reduce gpio calls countTimofey Titovets2025-04-171-10/+12
| | | | | | | | | gpio reset calls are heavy. gpio state are persistent between calls. Drop useless calls. Avoid calls if SDA does not changed. Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* i2c_software: allow freq adjustTimofey Titovets2025-04-171-0/+7
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* software_spi: set rate limiting ticks from the hostTimofey Titovets2025-04-171-9/+6
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* spi_software: respect expected rateTimofey Titovets2025-04-171-5/+32
| | | | | | | | On fast MCU software spi may violate maximally supported by TMC driver rate. Add dynamic limits to overcome that. Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* Revert "Makefile: Don't disable gcc's use-linker-plugin option"Kevin O'Connor2025-04-161-1/+0
| | | | | | | | This reverts commit 8087200ffe2fbbe62265dd480ce8be67db8349eb. The change can break the build on some versions of gcc. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Enable HAVE_LIMITED_CODE_SIZE on small atsamd chipsKevin O'Connor2025-04-162-0/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add some user visible comments to the optional features menuKevin O'Connor2025-04-161-7/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Simplify MakefileKevin O'Connor2025-04-161-31/+19
| | | | | | Breakout selection of timer and gpioperiph objects. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add new WANT_ADC option to reduce code sizeKevin O'Connor2025-04-168-18/+28
| | | | | | | Make it possible to not compile in support for ADC on chips with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add new WANT_I2C option to reduce code sizeKevin O'Connor2025-04-168-33/+43
| | | | | | | Make it possible to not compile in support for I2C on chips with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add new WANT_SPI option to reduce code sizeKevin O'Connor2025-04-168-27/+34
| | | | | | | Make it possible to not compile in support for SPI on chips with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add new WANT_HARD_PWM option to reduce code sizeKevin O'Connor2025-04-168-7/+14
| | | | | | | Make it possible to not compile in support for hardware pwm on chips with small flash sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Enable gcc -Os option on CONFIG_HAVE_LIMITED_CODE_SIZEKevin O'Connor2025-04-161-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Enable gcc -Os option on CONFIG_HAVE_LIMITED_CODE_SIZEKevin O'Connor2025-04-161-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Replace WANT_DISPLAYS with individual optionsKevin O'Connor2025-04-162-4/+12
| | | | | | Support setting WANT_ST7920 and WANT_HD44780 individually. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Replace WANT_GPIO_BITBANGING with individual optionsKevin O'Connor2025-04-162-7/+30
| | | | | | | | Support setting individual options instead of one global option ( WANT_BUTTONS, WANT_TMCUART, WANT_NEOPIXEL, WANT_PULSE_COUNTER, WANT_HX71X). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Don't disable gcc's use-linker-plugin optionKevin O'Connor2025-04-161-0/+1
| | | | | | | | | | | | | | | | This option seems to be confusing ld's region usage checks (builds that could fit in small chips are being reported as not fitting). The option was disabled back in commit 4e8674d5 because it showed worse results. However, recent versions of gcc seem to produce the same results even if this option is enabled, so change the build to avoid disabling that option on newer versions of gcc (those that have the -ffat-lto-objects option - which is needed to ensure compile_time_requests sections can be extracted with objcopy). The PRU build is dependent on -fuse-linker-plugin, so enable that option explicitly in its build. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2c_software: Fix i2c_delay()Kevin O'Connor2025-04-081-12/+9
| | | | | | | The i2c_delay() function did not properly handle counter rollovers. It also performed an expensive run-time divide. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Turn on can.c error interruptsKevin O'Connor2025-04-031-1/+1
| | | | | | | | It seems both ERRIE and LECIE must be enabled to get hardware error interrupts. Without this, the rx_error and tx_error reports are likely to always be zero. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for additional i2c busRussell Cloran2025-04-021-0/+3
| | | | Signed-off-by: Russell Cloran <rcloran@gmail.com>
* stm32: Fix RESERVE_PINS_CAN pin ordering in fdcan.cKevin O'Connor2025-04-011-1/+1
| | | | | | Always report the reserved pins in the same order (rx,tx). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Added PH13/14 CAN pin option for stm32h743 (#6857)FrY Sennberg2025-03-272-0/+14
| | | | | Added the option to select PH13/PH14 as CAN pins. Signed-off-by: Christoph Frei <fryakatkop@gmail.com>
* rp2040: define spi bus on pins 12,11,10Timofey Titovets2025-03-251-0/+3
| | | | | | Mellow FLY SHT36 Pro toolboard uses those pins Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stepper: Support disabling optimized "step on both edges" in "make menuconfig"Kevin O'Connor2025-03-202-9/+24
| | | | | | | Add a new "low level option" to allow users to configure if they want to optimize for Trinamic drivers or traditional stepper motor drivers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Support step on both edges with custom minimum pulse durationKevin O'Connor2025-03-209-30/+46
| | | | | | | | | | Add support for "step on both edges" to the main stepper_event_full() code. This makes that mode of operation available even when the micro-controller is not compiled for "optimized step on both edges". It also enables the custom pulse duration support (step_pulse_ticks) when in "step on both edges" mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for USART6 on STM32F401Marius Petcu2025-03-072-2/+28
| | | | | | | | | STM32F401 has USART6 on PA12/PA11 and PC7/PC6 with alternate function mapping AF08. This can be used, for example, to connect to the Elegoo Neptune 3, where PA12/PA11 are wired to an RJ10 plug going to the stock screen. Signed-off-by: Marius Petcu <marius@petcu.me>
* icm20948: Add support for ICM20948 accelerometer (#6756)Paul Hansel2025-03-043-1/+193
| | | Signed-off-by: Paul Hansel <github@paulhansel.com>
* usb_canbus: Send echo frame before processing the frameKevin O'Connor2025-02-271-34/+37
| | | | | | | | | | | The Linux kernel reports a canbus message as transmitted when it gets the echo frame back. Processing the message prior to sending the echo frame can lead to odd looking debugging logs (as the response messages may appear to predate the request messages). This doesn't impact the Klipper code, but it does make analyzing logs harder. Fix by sending the echo frame prior to processing the frame. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_canbus: Minor code cleanup - add new drain_host_queue() helperKevin O'Connor2025-02-271-15/+22
| | | | | | Separate code in usbcan_task() to new drain_host_queue(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_canbus: Minor code cleanup - code movement and comment updatesKevin O'Connor2025-02-271-36/+57
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_canbus: Wake usbcan_task when sending from canbus_sendKevin O'Connor2025-02-271-1/+1
| | | | | | | | | | | | | | Don't limit the canbus_notify_tx() wakeup to cases where notify_local is set - perform the wakeup whenever the host_status field indicates the main task has work pending. This fixes a small race condition where the main task could block sending a usb echo frame, and the canbus_send() code gets called as the usb bandwidth becomes available but before a usb wakeup notification is sent. In that situation, the usb code may not issue a wake event and the echo frames may be delayed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Fix build of rp2350Kevin O'Connor2025-02-261-6/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: set clock to 200MhzTimofey Titovets2025-02-261-2/+18
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* stm32: Add support for stm32f070x6 mcusKevin O'Connor2025-02-162-9/+13
| | | | | | This mcu has smaller memory and may require remapping of PA11/PA12. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Avoid ending a transmission with a max size usb packetKevin O'Connor2025-02-151-3/+5
| | | | | | | | | | | | | | | It seems the Linux kernel will consider a maximum size usb packet to be a transaction that will continue into the next usb packet. It will thus hold on to the traffic from the first packet until it gets the next packet. However, if the mcu has no further data to send after the first packet then the data could get delayed for an extended period of time. To avoid this, check for transmissions that could end on a maximum sized packet and send that data in two packets instead. This avoids this unusual corner case. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc_ep: Define endpoint sizes in usb_cdc_ep.hKevin O'Connor2025-02-153-8/+15
| | | | | | | | Move the definition of the usb endpoint sizes from usb_cdc.h to usb_cdc_ep.h . This allows individual boards to override the default endpoint sizes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: h7 spi support reload mode & frequencyTimofey Titovets2025-02-062-3/+17
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* usb_canbus: Detect canbus stalls when in usb to canbus bridge modeKevin O'Connor2025-02-021-3/+57
| | | | | | | | | | | | | | | If the low-level canbus stops working then it could become impossible to send messages to and from the canbus bridge node itself. This can make it difficult to diagnose canbus problems. Change the canbus bridge code to detect if message transmits become stalled for 50+ milliseconds and go into a "discarding" state. In this discarding state, messages destined for the canbus will be discarded until the canbus becomes active again. In this discarding state it will therefore be possible to transmit messages to and from the canbus bridge node. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* canbus_stats: Periodically report canbus interface statisticsKevin O'Connor2025-02-021-1/+20
| | | | | | | | | Add support for a new get_canbus_status command to canserial.c . Add new canbus_stats.py module that will periodically query canbus mcus for connection status information. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Add support for reporting canbus stateKevin O'Connor2025-02-021-2/+47
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Add support for reporting canbus stateKevin O'Connor2025-02-021-2/+47
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* rp2040: Add support for reporting canbus stateKevin O'Connor2025-02-021-1/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for reporting canbus state from fdcan.cKevin O'Connor2025-02-021-2/+47
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>