Now the NEC reading code is more cautious about what it accepts, more
readily throwing away input if anything odd is read. It also, and this
is the big one, sends an event as soon as it's read all 32 bits, so I
can actually read short button presses now(!). I'm not aware of any
major reliability problems left, so I'm leaving the translator by the TV
for now.
The comparisons were long-winded and repetitive, so I made a macro to
make them more concise. Also, all the NEC timing macros now have names
starting with NEC_.
Now the NEC reading code doesn't leak excessive information to the rest
of the firmware, keeping its internal state in static variables at
function scope.
It looks for the signal sent by the MINIX remote's power button and
sends the one sent by the GO.VIDEO remote's power button. It has a few
reliability problems and the code's a bit of a mess, so there's still
work to do.
This commit adds some functions for sending RC5 signals. The main
thread uses these functions to send the TV power off signal continuously
after booting. The timings are supposed to match the RC5 standard, but
the carrier is 38 kHz because I don't know. The TV seems to like what
I'm sending it, so I'm not worried.
Based on ChibiOS's RT-STM32F103RB-NUCLEO64 example, reconfigured for the
STM32F103C8_MINIMAL board and organized the way I like to organize my
ChibiOS projects.