aboutsummaryrefslogtreecommitdiffstats
path: root/src/avr
Commit message (Collapse)AuthorAgeFilesLines
* Kconfig: Add new WANT_ADC option to reduce code sizeKevin O'Connor2025-04-161-1/+1
| | | | | | | 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-161-1/+1
| | | | | | | 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-161-1/+1
| | | | | | | 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-161-1/+1
| | | | | | | 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>
* 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>
* sched: Improve timer vs task priority checkKevin O'Connor2024-10-261-1/+1
| | | | | | | | | | | | | | | Rename sched_tasks_busy() to sched_check_set_tasks_busy() and change it to only return true if tasks are active (running or requested) for two consecutive calls. This makes it less likely that timers will yield to tasks except when tasks really are notably backlogged. This also makes it less likely that multiple steppers controlling the same rail will be interrupted by tasks mid-step. This should slightly improve the timing, and make it less likely that a halt during homing/probing will occur with these steppers taking a different number of total steps. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2c: handle errors at i2ccmdsTimofey Titovets2024-10-262-4/+9
| | | | Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
* avr: enable small code size options for atmega32u4Jake2024-03-021-1/+1
| | | | Signed-off-by: Jake Beju <jake.beju@gmail.com>
* avr: enable small code size options for 328 and 328p (#6411)CODeRUS2023-11-291-1/+1
| | | Signed-off-by: Andrei Kozhevnikov <coderusinbox@gmail.com>
* Kconfig: Support selecting optional features on chips with small flash sizeKevin O'Connor2023-06-081-1/+1
| | | | | | | | | | | | | Add a new HAVE_LIMITED_CODE_SIZE symbol that enables a menu to select optional features. This symbol is enabled on chips with small build sizes. Replace the HAVE_GPIO_BITBANGING with four new symbols: WANT_GPIO_BITBANGING, WANT_DISPLAYS, WANT_SENSORS, WANT_SOFTWARE_SPI, and WANT_SOFTWARE_I2C. This allows users a little more flexibility when selecting features they need. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Allow I2C bus speed to be set by Klipper (#6111)Dr. Matthew Swabey2023-03-211-20/+16
| | | | | Allow I2C bus speed to be set by appropriate Klipper commands. Signed-off-by: Matthew Swabey <matthew@swabey.org>
* avr: No need to define bootloader_request()Kevin O'Connor2022-12-301-6/+0
| | | | | | | Since avr does not define HAVE_BOOTLOADER_REQUEST it is not necessary to define the function. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Rename usb_request_bootloader() to bootloader_request()Kevin O'Connor2022-07-291-1/+2
| | | | | | | Rename this board API function to a more generic name. This is in preparation for calling the function from the canbus code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Make step pulse duration customizable at run-timeKevin O'Connor2021-11-041-3/+0
| | | | | | | | | | | | 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>
* 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>
* avr: Fix Kconfig USB/Serial selectionKevin O'Connor2021-03-181-1/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Use "communication interface" menu option in KconfigKevin O'Connor2021-03-181-12/+13
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Add a new CONFIG_HAVE_STRICT_TIMING build definitionKevin O'Connor2020-05-311-0/+1
| | | | | | | | Add a new build definition to note micro-controllers that have strict timing. The Linux mcu code does not have strict timing - all other targets currently do. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: implement i2c_readArksine2020-01-131-1/+18
| | | | Signed-off-by: Eric Callahan <arksine.code@gmail.com>
* avr: List 20Mhz option below 16Mhz option in KconfigKevin O'Connor2019-09-301-2/+2
| | | | | | | | When enabling "low level options" in Kconfig, selecting a chip that is 20Mhz capable would result in 20Mhz being the default. A 16Mhz speed is the preferred default, so list that first in the menu. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Simplify spi mode settingKevin O'Connor2019-05-071-22/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Use enumerations for buses and reserve pinsKevin O'Connor2019-04-044-7/+33
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Add enumerations for the atmega168/328 analog only pinsKevin O'Connor2019-03-311-0/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Use enumerations for pin mappingsKevin O'Connor2019-03-171-0/+18
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Always pass a string to the DECL_CONSTANT() macroKevin O'Connor2019-03-174-4/+4
| | | | | | | | 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>
* stepper: Support an optimized step/unstep function on ARMKevin O'Connor2019-03-101-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Reduce use of $^ in build rulesKevin O'Connor2019-03-021-2/+2
| | | | | | | 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>
* avr: Wrap code to 80 columnsKevin O'Connor2019-02-273-3/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pins: Add support for pull down resistorsKevin O'Connor2019-02-271-2/+2
| | | | | | | Add initial support for selecting pull down resistors (for micro-controllers that support it). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Only prompt for cpu speed and uart port on LOW_LEVEL_OPTIONSKevin O'Connor2019-02-161-3/+3
| | | | | | | 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>
* avr: Only prompt for CLEAR_PRESCALER and SIMULAVR with LOW_LEVEL_OPTIONSKevin O'Connor2019-01-251-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Kconfig: Move SERIAL_BAUD to src/Kconfig and show with LOW_LEVEL_OPTIONSKevin O'Connor2019-01-251-4/+0
| | | | | | | | Move the definition of SERIAL_BAUD to the main src/Kconfig file. Only show this as an option if the user selects the ability to configure low-level options. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Rename AVR_SERIAL and AVR_USBSERIAL to SERIAL and USBSERIALKevin O'Connor2019-01-252-8/+8
| | | | | | | Rename the config options to be more consistent with other architectures. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Support configuring the stepper pulse length from KconfigKevin O'Connor2019-01-091-1/+3
| | | | | | | Allow the stepper pulse length to be configured at compile time from the Kconfig menu system. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* i2ccmds: Pass the i2c address as a 7-bit number (0-127)Kevin O'Connor2019-01-071-1/+1
| | | | | | | | | | | | | | | | The sam3 i2c code and the linux code use a 7-bit i2c address, while the avr, lpc176x, and samd21 i2c code uses an 8-bit address with the least significant bit always zero. A similar issue occurred in the host code (sx1509.py and replicape.py use 7-bit addresses while uc1701.py and mcp4451.py use 8-bit addresses). Consistently use 7-bit addresses in all the code. This breaks compatibility between host and mcu software, so make a change to the config_i2c command to force users to synchronize software updates. This also breaks common Smoothieboard configs, so update the mcp4451 code to validate the i2c_address. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Add support for detecting a USB level Arduino bootloader requestKevin O'Connor2018-12-241-0/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spicmds: Check for an incorrect mode in spicmds.cKevin O'Connor2018-11-301-1/+1
| | | | | | | Check the mode parameter in spicmds.c so that the mcu code does not need to check it. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Add support for sending I2C messagesKevin O'Connor2018-11-234-0/+114
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Minor comment update in hard_pwm.cKevin O'Connor2018-11-201-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Rework hardware pwm pin definitionsKevin O'Connor2018-11-201-56/+48
| | | | | | | Simultaneously define the hardware pin and the timer registers. This makes the table a little easier to understand. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Split gpio.c into gpio.c, adc.c, hard_pwm.c, and spi.cKevin O'Connor2018-11-206-391/+418
| | | | | | | Split up gpio.c into multiple files in an effort to make the code a little more understandable. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Add initial support for atmega32u4 chipsKevin O'Connor2018-11-203-12/+32
| | | | | Signed-off-by: Trevor Jones <trevorjones141@gmail.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Minor update to help text in KconfigKevin O'Connor2018-11-191-2/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* 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>
* 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>
* 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>
* 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>