From Harri Luhtala <harri.luhtala@haltian.com>. Tested with earlier version of NuttX; with current version checked that it compiles.