aboutsummaryrefslogtreecommitdiffstats
path: root/src/avr/serial.c
Commit message (Collapse)AuthorAgeFilesLines
* build: Use compile_time_request system for init, tasks, and shutdownKevin O'Connor2017-05-261-1/+1
| | | | | | | | Avoid using linker magic to define the init, task, and shutdown functions. Instead, use the compile_time_request system. This simplifies the build and produces more efficient code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* avr: Remove F_CPU compile time definitionKevin O'Connor2017-03-301-2/+4
| | | | | | | | Directly use the Kconfig defined CONFIG_CLOCK_FREQ in the code and avoid defining F_CPU. Also, remove the unnecessary O2 option - that is already the default from the main makefile. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* io.h: read/write[bwl] should use barrierKevin O'Connor2017-02-021-3/+0
| | | | | | | Add barrier() calls to low-level read/write io calls so that their callers don't need to. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serial: Be careful with comparison of transmit_max to transmit_posKevin O'Connor2017-01-141-1/+1
| | | | | | | | There is a small possibility that a shutdown could occur between clearing transmit_max and clearing transmit_pos - so make sure to handle the case where transmit_pos > transmit_max. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: No need to disable irqs in sendf reentrant checkKevin O'Connor2017-01-141-0/+1
| | | | | | | | | As long as the code is careful when writing the in_sendf variable it should be safe to update it without having to disable irqs. Also, make sure in_sendf is cleared on shutdown. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Define DECL_CONSTANT mechanism for defining exported constantsKevin O'Connor2016-12-231-0/+3
| | | | | | | | | Add a DECL_CONSTANT macro to allow the firmware to define constants that are to be exported to the host during the "identify" phase. This replaces the existing hardcoded mechanism of scanning the Kconfig header file for certain constants. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* serial: Increase AVR serial receive bufferKevin O'Connor2016-10-181-3/+2
| | | | | | | | Increase the size of the serial receive buffer. With transmit rates of 250000 baud, it only takes a little over a millisecond to overflow the existing buffer. 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>
* irq: Allow boards to define the return type of irq_save()Kevin O'Connor2016-06-131-1/+1
| | | | | | | | 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>
* generic: Add new file generic/io.h and move read/writeb() to itKevin O'Connor2016-06-131-0/+1
| | | | | | | | 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: Create generic board infrastructure and move misc.h to itKevin O'Connor2016-06-131-1/+1
| | | | | | | 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>
* Initial commit of source code.Kevin O'Connor2016-05-251-0/+137
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>