Adding in additional abstractions would probably be unnecessary overhead for an embedded system. The code the author wrote, while a bit repetitive, maps fairly straightforwardly to assembly.