AVR-GCC for Linux doesn't handle well 16 bit words

I'd expect that a RTOS does not allow tasks to block interrupts. Instead the macros for critical sections or atomic reads should be used.