aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* avr: Add support for atmega328pKevin O'Connor2018-10-292-5/+8
| | | | | | | The atmega328p is basically the same as the atmega328 - add explicit support for it so that avrdude doesn't complain while flashing. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Implement I2C support in the SAM4E8E portFlorian.Heilmann2018-10-275-1/+198
| | | | Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
* Add generic i2c interfaceFlorian.Heilmann2018-10-273-0/+80
| | | | Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
* sam3x8e: Don't report an error if bossac errors during device restartKevin O'Connor2018-10-221-1/+1
| | | | | | | Sometime bossac reports an error during chip restart. It appears this error is spurious - just suppress it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Enable SAM4 cache at startupKevin O'Connor2018-10-221-0/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Divide system clock within timer; not on system busKevin O'Connor2018-10-181-0/+3
| | | | | | | Scaling the timer on the system bus has a notable impact on performance. So, scale the timer within the timer hardware itself. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3x8e: Align loops to a 16 byte boundaryKevin O'Connor2018-10-131-1/+1
| | | | | | | | | It appears the sam3x8e has a primitive cache prefetch mechanism (it prefetches 32 bytes at a time aligned to a 16 byte boundary). Aligning the main loop in timer_dispatch_many() to a 16 byte boundary significantly improves performance. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Force sched_try_shutdown to be inlinedKevin O'Connor2018-10-131-1/+1
| | | | | | | | | If sched_try_shutdown() is not inlined into timer_dispatch_many() it can have a significant impact on benchmarks. (Even though the function isn't called in practice, the call causes gcc to organize the function differently.) Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_irq: Fix jump target alignmentKevin O'Connor2018-10-131-2/+2
| | | | | | The jump target needs to be 4 byte aligned (not 2^4 bytes). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Use __always_inline on timer_read_timeKevin O'Connor2018-10-111-1/+1
| | | | | | | | Some older versions of gcc need the __always_inline directive in order to inline timer_read_time. Inlining that function is important for performance on the stm32f1. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Use -O2 optimization and inline timer_read_time()Kevin O'Connor2018-10-112-2/+1
| | | | | | | | As long as timer_read_time() is inlined, I get better performance with gcc -O2 optimization. The binary is also dramatically smaller and O2 better matches the other platforms. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Use the main lib/cmsis-core directory for cmsis includesKevin O'Connor2018-10-111-2/+2
| | | | | | Use the main cmsis header files with stm32f1. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Add support for building with bootloader supportKevin O'Connor2018-10-114-2/+136
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Move assembler build rules togetherKevin O'Connor2018-10-111-10/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Pull the USB D+ line low briefly to signal a device connectKevin O'Connor2018-10-111-0/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Initial support for serial over USBKevin O'Connor2018-10-113-1/+286
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Serial should have a higher irq priority than timersKevin O'Connor2018-10-112-3/+2
| | | | | | | | | It's possible for the code to stay in the timer irq for up to 100ms, so serial irqs should have a higher irq priority to prevent them from being starved. (The timer code disables irqs during event dispatch, so serial irqs would only be permitted between events anyway.) Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Disable usb serial interrupts while processing dataKevin O'Connor2018-10-021-6/+10
| | | | | | | There's no need to keep taking interrupts if the high-level code is busy processing messages. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: No need to reset ep0 interrupts on a shutdownKevin O'Connor2018-10-021-7/+0
| | | | | | | The usb_cdc code will arrange to call usb_read_ep0_setup() after a shutdown, so no need to have an explicit shutdown handler. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Try to read new data before processing data blocksKevin O'Connor2018-10-021-9/+12
| | | | | | | | Call usb_read_bulk_out() before calling command_find_and_dispatch() as this optimizes the common case where each usb packet contains a single new message block. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Wake usb_bulk_out_task() on a shutdownKevin O'Connor2018-10-021-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Allow the serial port to be selected on the atmega2560/1280Kevin O'Connor2018-10-011-10/+17
| | | | | | | Allow the serial port to be selected on the atmega2560 and atmega1280 chips in Kconfig. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buttons: Clear pressed/last_pressed state on new buttons_query commandKevin O'Connor2018-10-011-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Increase stack size to 256 for all AVR targetsKevin O'Connor2018-10-011-2/+1
| | | | | | | | Recent code additions have increased the stack usage and it is no longer clear that everything will fit in 128 bytes. Increase all targets to 256 bytes (the atmega2560 was already at 256 bytes). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usbstd: Force usb_string_descriptor data field to match unicode stringKevin O'Connor2018-09-301-1/+2
| | | | | | | Fix travis-ci build failure by forcing the data field of the struct usb_string_descriptor to be the same type as a 16bit unicode string. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Use generic usb_cdc code for usb serial supportKevin O'Connor2018-09-302-46/+225
| | | | | | | Use the generic usb_cdc driver code instead of the "pjrc" usb driver code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Perform basic request validationKevin O'Connor2018-09-301-1/+25
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Add usb_read_ep0_setup() interface functionKevin O'Connor2018-09-304-2/+14
| | | | | | | Use new usb_read_ep0_setup() function when reading a setup packet - this allows the low-level usb hardware code to better handle errors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Add support for usb_send_ep0_progmem()Kevin O'Connor2018-09-304-2/+9
| | | | | | | Add support for explicitly sending to the ep0 pipe from constant "progmem" memory on the AVR. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Fix handling of zero-length-packetsKevin O'Connor2018-09-301-5/+10
| | | | | | | A zero length packet should only be sent at the end of a transmission if the host is expecting more data. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Rework transfer state tracking codeKevin O'Connor2018-09-301-39/+40
| | | | | | | Maintain the state tracking code entirely within a usb_do_xfer() method. This simplifies the callers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Rename interface functions to avoid the term "setup"Kevin O'Connor2018-09-304-33/+32
| | | | | | | Use "ep0" when referring to endpoint0 - don't use "setup" as that can be confused with the low-level usb setup token. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmc2208: Initial support for configuring TMC2208 driversKevin O'Connor2018-08-272-1/+251
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-12/+28
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pru: Add wrappers for gpio_x_reset()Kevin O'Connor2018-08-272-0/+14
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* simulator: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-0/+6
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-15/+37
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-30/+38
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3x8e: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-19/+35
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-15/+44
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Add support for gpio_x_reset()Kevin O'Connor2018-08-272-12/+26
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Don't require 2ms pad in sched_add_timer()Kevin O'Connor2018-08-271-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Disable HAVE_GPIO_BITBANGING on atmega168Kevin O'Connor2018-08-271-1/+1
| | | | | | | The atmega168 doesn't have enough flash space to fit all features - disable the "bit banging" interfaces to make room. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* samd21: Enable HAVE_GPIO_BITBANGINGKevin O'Connor2018-08-271-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Rename HAVE_USER_INTERFACE to HAVE_GPIO_BITBANGINGKevin O'Connor2018-08-277-7/+7
| | | | | | | Rename the HAVE_USER_INTERFACE definition in preparation for other "bit banging" interfaces. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Use local copy of bossac for flashingKevin O'Connor2018-08-271-3/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam3x8e: Use local copy of bossac for flashingKevin O'Connor2018-08-271-3/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Fix bug in sam4e gpio.c (#563)Florian Heilmann2018-08-242-5/+14
| | | | | The bank_id was calculated erroneously. Also unify gpio_in_setup and gpio_out_setup a bit. Also disable make flash for the sam4e8e port as it currently references a version of bossac that is not present on all systems. Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>
* samd21: Fix description of bootloader offsetKevin O'Connor2018-08-081-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sam4e8e: Add the SAM4e8e portFlorian Heilmann2018-08-089-0/+780
| | | | | | | | This can be flashed to e.g. the duet wifi using bossac. It requires a later version as is currently included in the klipper repo (1.8 vs. 1.2). Comms are currently via UART0 only, USB serial is still TBD Signed-off-by: Florian Heilmann <Florian.Heilmann@gmx.net>