90% of embedded code is horrible global variable messes like that, it's truly horrifying if you value CS and SE sensibilities and get into embedded. Invariably you'll also be expected to interface to and utilitise someone else's code of that style, so you can't even try to make much of a positive impact from within.