aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* sam3x8e: Add initial support for Arduino Due boardsKevin O'Connor2016-06-149-2/+599
| | | | | | | This adds basic support for running on the Atmel SAM3x8e micro-controllers that are found in the Arudino Due boards. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Support rescheduling of step events on faster MCUsKevin O'Connor2016-06-143-19/+80
| | | | | | | | | | On faster MCUs the step and unstep events may be too close for the stepper motor driver. Add a CONFIG_NO_UNSTEP_DELAY build option and support the case where it is not set. This allows faster MCUs to schedule two events for each step (one for the step and one for the unstep). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Update declfuncs.lds.S to only use progmem sections on AVRKevin O'Connor2016-06-142-5/+16
| | | | | | | On non-avr platforms the declfunc stuff still needs to be in the binary in a rodata section. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr/serial: Separate out low-level hardware manipulation to its own functionKevin O'Connor2016-06-141-3/+9
| | | | | | | Introduce enable_tx_irq() for manipulating the AVR hardware. This keeps the low-level hardware code together. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Default to O2 optimizationKevin O'Connor2016-06-141-1/+1
| | | | | | | Default to O2 and set Os in the AVR makefile. Platforms besides AVR are likely to produce better code with O2 so make that the default. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Use 'unsigned int' instead of 'uint16_t' for shutdown reasonKevin O'Connor2016-06-142-4/+4
| | | | | | | Use 'unsigned int' instead of 'uint16_t' as is faster on some platforms. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Use uint_fast8_t for return type of timersKevin O'Connor2016-06-147-14/+14
| | | | | | | | Some architectures are faster passing regular integers than 8bit integers. Use uint_fast8_t so that the architecture chooses the appropriate type. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* irq: Allow boards to define the return type of irq_save()Kevin O'Connor2016-06-138-25/+33
| | | | | | | | The AVR wants a uint8_t return type for irq_save(), but other architectures will generally prefer int. Allow the board to configure the size of the flag by introducing an irqstatus_t typedef. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* irq: Prefer irq_disable/enable instead of irq_save/restore in cmds/tasksKevin O'Connor2016-06-134-13/+13
| | | | | | | | Task and command handlers always run with irqs enabled, so it is not necessary to save/restore the irq state when disabling irqs in these handlers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pwmcmds: Add Kconfig option to allow boards to disable hardware PWM commandsKevin O'Connor2016-06-135-70/+85
| | | | | | | | Some boards may not support hardware based PWM. Update the build so that those commands do not need to be compiled if they are not available. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spicmds: Add Kconfig option to allow boards to disable SPI commandsKevin O'Connor2016-06-133-1/+6
| | | | | | | Some boards may not support SPI transfers. Update the build so that those commands do not need to be compiled if they are not available. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gpiocmds: Add Kconfig option to allow boards to disable ADC commandsKevin O'Connor2016-06-135-111/+132
| | | | | | | | Some boards may not support the ADC hardware. Update the build so that those commands do not need to be compiled if they are not available. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* compiler.h: Check if __aligned and __section macros are already definedKevin O'Connor2016-06-131-0/+4
| | | | | | | Don't define these macros if they are already - doing so causes compiler warnings. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Move listing of directories to create to board makefilesKevin O'Connor2016-06-132-0/+4
| | | | | | Rename DIRS to dirs-y and populate it in the per-board Makefile rules. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* generic: Add new file generic/io.h and move read/writeb() to itKevin O'Connor2016-06-133-19/+26
| | | | | | | | Move the definitions of the readb() style functions to a new header generic/io.h. This eliminates the dependency of stdint.h on compiler.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* generic: Move simulator/gpio.h to generic/gpio.hKevin O'Connor2016-06-132-3/+3
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* generic: Move simulator/irq.h to new file generic/irq.hKevin O'Connor2016-06-134-34/+46
| | | | | | | Move the generic irq definitions into generic/irq.h and move the simulator irq code into main.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* generic: Move board timer.h files into generic/misc.hKevin O'Connor2016-06-135-26/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* generic: Create generic board infrastructure and move misc.h to itKevin O'Connor2016-06-1310-68/+69
| | | | | | | Instead of creating a misc.h file in each board directory, create a generic board directory and declare misc.h there. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Optimize timer list handlingKevin O'Connor2016-06-131-39/+50
| | | | | | Rework the timer list rescheduling to be more optimized. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Optimize for case where add is zeroKevin O'Connor2016-06-131-11/+15
| | | | | | | At high rates, the "add" field is frequently zero. It's possible to optimize for that case. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* gpio: Fix off-by-one bug in check for the maximum gpio portKevin O'Connor2016-06-131-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Add config option to clear the CPU prescalerKevin O'Connor2016-06-052-0/+23
| | | | | | | Some AVR chips ship with a 1/8th clock divisor set. Add a compile time option to manually clear this field at startup. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Separate out gpio pwm pin definitions from pwm register definitionsKevin O'Connor2016-06-051-41/+44
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Eliminate gpio_adc_info struct in gpio adc pin definitionsKevin O'Connor2016-06-051-17/+12
| | | | | | | The gpio_adc_info only contains a single uint8_t field - it's simpler to use an array of uint8_t instead. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Define timer1 timers and prevent their use as PWM at runtimeKevin O'Connor2016-06-051-10/+12
| | | | | | | Instead of commenting out the timer1 pwm definitions, detect them at runtime. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Initial support for Atmel AT90USB1286 mcuKevin O'Connor2016-06-054-2/+93
| | | | | | | Add GPIO definitions for the AT90USB1286. Add code for communicating over USB port on AT90USB1286. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* sched: Change sched_from_ms() to sched_from_us()Kevin O'Connor2016-06-027-16/+16
| | | | | | | Some code may require micro-second precision so update sched_from_ms() to use micro-seconds. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stepper: Use stepper_stop() instead of stepper_reset() in stepper_shutdown()Kevin O'Connor2016-06-021-13/+6
| | | | | | | The stepper_stop() function is equivalent to stepper_reset() during a shutdown event. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* timer: Move union u32_u16_u from compiler.h to avr/timer.cKevin O'Connor2016-06-012-6/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Initial commit of source code.Kevin O'Connor2016-05-2536-0/+3129
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>