CMU-Robotics-Club/RoboBuggy — pull request #96 by ihartwig (2014-11-04 07:09:37+00:00)
Title: Wholesale wrapping of RC receiver code in a class to keep track of instance data.

In order to add new input pins from the RC receiver without copy-pastaing more loops and not-well-named variables we've wrapped the receiver code into an instance for each channel of RC signal. The wrapping does not change the algorithm we are using to read the pulse width nor greatly modify the top level usage. In lieu of having an interrupt dispatcher, the OnInterruptReceiver must be wrapped by a static function and fed back into the Begin method for attachment.

Known Issues:
* These warnings should be resolved. They came with the unchanged pulse width calculation code:
* pinreceiver.cpp: In member function 'void PinReceiver::OnInterruptReceiver()':
* pinreceiver.cpp:41: warning: comparison between signed and unsigned integer expressions
* pinreceiver.cpp:42: warning: comparison between signed and unsigned integer expressions
* pinreceiver.cpp:48: warning: statement has no effect
* There are more instance variables than necessary. Should determine which constants actually need to be present.
* Magic numbers everywhereeeeeee.
* Instance variables do not follow the _ at the end convention.

Further testing is needed to confirm functionality on the real system before this code is merged.