cpu/stm32l1: optimized and fixed timer driver#3856
cpu/stm32l1: optimized and fixed timer driver#3856haukepetersen merged 4 commits intoRIOT-OS:masterfrom
Conversation
There was a problem hiding this comment.
A division for every time referencing a constant value?
There was a problem hiding this comment.
The constant will be computed by the compiler at compile time, there won't
be a division at run time.
On Sep 15, 2015 8:18 PM, "A-Paul" [email protected] wrote:
In boards/nucleo-l1/include/periph_conf.h
#3856 (comment):-#define TIMER_1_MAX_VALUE (0xffff)
-#define TIMER_1_CLKEN() (RCC->APB1ENR |= (RCC_APB1ENR_TIM4EN | RCC_APB1ENR_TIM5EN))
-#define TIMER_1_ISR_0 isr_tim4
-#define TIMER_1_ISR_1 isr_tim5
-#define TIMER_1_IRQ_CHAN_0 TIM4_IRQn
-#define TIMER_1_IRQ_CHAN_1 TIM5_IRQn
-#define TIMER_1_IRQ_PRIO 1
-#define TIMER_1_TRIG_SEL TIM_SMCR_TS_1
+static const timer_conf_t timer_config[] = {
- /* device, RCC bit, IRQ bit */
- {TIM5, 3, TIM5_IRQn},
+};
+/* interrupt routines /
+#define TIMER_0_ISR (isr_tim5)
+/ number of defined timers */
+#define TIMER_NUMOF (sizeof(timer_config) / sizeof(timer_config[0]))A division for every time referencing a constant value?
—
Reply to this email directly or view it on GitHub
https://github.com/RIOT-OS/RIOT/pull/3856/files#r39546009.
|
adjusted configuration for the |
94591e0 to
e0f1c6c
Compare
|
@ReneHerthel took it home. So he has to. I'll also send him a private mail |
|
thx |
|
Okey, I cloned this branch and tested it with the xtimer-test applications from RIOT. |
I think this is okay, because this test is only for platforms with timers smaller than 32 bit. |
|
Needs rebase |
e0f1c6c to
7f46297
Compare
|
rebased |
|
@OlegHahm, care to give this a fix test-run? |
|
Ah, now I remember. I cannot test, because I don't any output on this board. |
|
If I tell you it's working fine here, does that suffice? |
|
Or you can come over and I give you a live demo (as live demos always work...) :-) |
|
Okay, got it working with the second UART, but No further output. |
|
Wait, it's weird. Somehow flashing doesn't seem to work. |
|
Ok, fixed that, but got the same result for xtimer_set_msg as above. |
|
hmm, here it does not stop, though I get the same faulty output... |
7f46297 to
92ee5d9
Compare
|
should be fixed now. |
|
@OlegHahm: now |
|
ACK |
|
Travis is happy -> and go. |
cpu/stm32l1: optimized and fixed timer driver
There was a problem hiding this comment.
First argument should be "1" here, shouldn't it?
saves ~600 byte ROM and looks nicer :-)
also #3525 works nicely with this.