aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32f1/timer.c
Commit message (Collapse)AuthorAgeFilesLines
* 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-111-1/+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: Serial should have a higher irq priority than timersKevin O'Connor2018-10-111-2/+1
| | | | | | | | | 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>
* stm32f1: Use generic timer_irq.c dispatch codeKevin O'Connor2018-04-201-62/+3
| | | | | | | | | With the optimized timer_read_time() it is no longer necessary to implement custom timer dispatch code - use the generic mechanism in timer_irq.c. This simplifies the code and provides a small performance increase. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Use different method for handling 16bit -> 32bit timer conversionKevin O'Connor2018-04-201-47/+39
| | | | | | | Implement 32bit timer conversion without disabling interrupts. This uses the 16th bit of timer_high as a rollover detection flag. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32f1: Prefer uint32_t over uint16_t in timer.cKevin O'Connor2018-04-201-6/+6
| | | | | | | The ARM architecture handles 32bit values faster than 16bit values - use uint32_t where possible. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Add STM32F103 portGrigori Goronzy2018-04-091-0/+188
Add a fully functional STM32F1 port, currently mostly targeting STM32F103 microcontrollers. This requires an 8 MHz XTAL. The maximum possible step rate is around 282K steps per second. This uses stm32flash to burn the firmware. The bootloader needs to be started by setting BOOT0 to 1 and resetting the MCU. There is no automatic bootloader, unlike on Arduino. Signed-off-by: Grigori Goronzy <greg@kinoho.net>