aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/timer.c
Commit message (Collapse)AuthorAgeFilesLines
* timer.c: Minor IRQ dispatch tweaks.Marti Bolivar2011-07-211-3/+3
| | | | | | Read TIMx_SR before grabbing a pointer to the user handlers instead of after. This should shave a couple of cycles off of the time between IRQ entry and SR read.
* timer.c: Optimize IRQ dispatch routines.Marti Bolivar2011-07-201-59/+66
| | | | | | | | | | | | | | | | | Remove dispatch_irq() and dispatch_cc_irqs(). For IRQs which handle exactly one timer interrupt, add new dispatch_single_irq(). The mere fact that the IRQ has been called suffices to prove that its interrupt enable bit (in TIMx_DIER) and interrupt flag (in TIMx_SR) are set. These facts are combined in dispatch_single_irq(), which only needs to check if the timer_dev handler is non-null before calling it and clearing the SR flag. For IRQs which serve multiple timer interrupts, replace the composition of calls to dispatch_irq() and dispatch_cc_irqs() with individualized routines. These eliminate unnecessary timer register reads/writes, and, in the case of capture/compare interrupts, have a loop unrolling performed.
* timer.c: Fix dispatch_irq() and dispatch_cc_irqs().Marti Bolivar2011-07-191-24/+46
| | | | | Modify them to check whether the relevant interrupts are enabled before attempting to handle them.
* timer.c: Fix off-by-one error in NR_GEN_HANDLERS.Marti Bolivar2011-07-181-1/+1
|
* timer: Shortening long names.Marti Bolivar2011-05-191-3/+3
| | | | | Various names in timer.h were too unwieldy. Making these slightly more bearable.
* timer: Moving some Doxygen comments.Marti Bolivar2011-05-191-0/+8
| | | | From declaration to definition, to keep with convention.
* Timer tweaks.Marti Bolivar2011-04-071-18/+12
|
* Final stm32_pin_info design candidate; ADC3 support on Native.Marti Bolivar2011-03-251-2/+2
| | | | | | | | | | | | | | | | | | | | Added an adc_dev to struct stm32_pin_info. This was necessary to add support for the channels on the Native which are only connected to ADC3, but it does add a bunch of NULLs to the PIN_MAPs. I don't think any other peripherals need representation on a per-pin basis. Each peripheral library will be responsible for keeping track of related GPIO ports and bits, and we can throw #defines in to boards/*.h for other things (e.g. BOARD_SPI1_MISO_PIN). Fleshed out the ADC refactor and brought it more in keeping with the new design as it evolves. A couple of other tweaks. Notably: waitForButtonPress() now takes a default argument meaning "wait forever". Removed Maple-specific documentation from core functions in io.h; this information will need to go into the individual board docs files.
* Initial timer refactor.Marti Bolivar2011-03-241-0/+449
Basic PWM works. Had some problems in testing that might be due to USART bugs. HardwareTimer has been removed from the build for now; I will re-implement it in terms of the new libmaple API, but consider it deprecated. Let's come up with something better. Servo is implemented in terms of HardwareTimer, so it also has been temporarily removed from the build. pwmWrite() likely got a little bit less inefficient due to indirection, but the PIN_MAPs shrank by a pointer per PinMapping.