Matthew Lai <m...@matthewlai.ca> wrote:
> Oops, looks like I only replied to Chuck.
> 
> --------------------------------------------------------------------------
> 
> When compiling with optimizations, I would expect 
> rcc_periph_clock_enable() to be inlined even at -Os since
> function body (one instruction after constant propagation) is
> smaller than the code to call the function.

except it probably won't, because it's not static, and not marked
inline. It might get inlined if you use LTO, but I wouldn't rely
on it.

eg

```
        rcc_periph_clock_enable(RCC_TIM6);
 80008bc:       f240 4084       movw    r0, #1156       ; 0x484
 80008c0:       f001 ffeb       bl      800289a <rcc_periph_clock_enable>
        rcc_periph_clock_enable(RCC_TIM7);
 80008c4:       f240 4085       movw    r0, #1157       ; 0x485
 80008c8:       f001 ffe7       bl      800289a <rcc_periph_clock_enable>
```

> 
> Peripherals on APB would also need more cycles.
> 
>  >> Try to break it. You know the conditions try to create them.
> 
> I suspect it's not so easy to reproduce - otherwise we would be
> seeing many more bug reports.
> 
> It may only happen for some peripherals when the peripheral and
> the CPU are in specific states.
> 
> I don't think trying to break it would really be useful - a
> positive result means we need to fix it, and a negative result
> still doesn't mean we don't have to worry about it.
> 


I would ignore it.  There's very few places where it will really matter, and 
the people who will need it, will be handling it themselves anyway, not using 
high level helper functions.  

Attachment: signature.html
Description: OpenPGP Digital Signature

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
libopencm3-devel mailing list
libopencm3-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libopencm3-devel

Reply via email to