[riot-notifications] [RIOT-OS/RIOT] cpu/atmega_common: RTT and RTC support (#8842)

Marian Buschsieweke notifications at github.com
Fri Apr 19 08:49:09 CEST 2019


@ZetaR60: If my interpretion of the standard is indeed wrong, you should go for [compiler memory barriers](https://en.m.wikipedia.org/wiki/Memory_ordering#Compiler_memory_barrier) instead of `volatile`, as those have less impact on performance.

```C
static inline void disable_timer_int(void) {
    asm volatile("" ::: "memory");
    TIMSK2 &= ~(1 << OCIE2A);
    asm volatile("" ::: "memory");
```

and the same for reenable. That will do exactly what is intended and not disable any more optimisation than needed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/8842#issuecomment-484784168
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190418/b6710760/attachment.html>


More information about the notifications mailing list