Fix get_io_control_callback

There was a problem with passing the pointer to a pointer to a uint8_t.
Changed the code to no longer pass that buffer around and einstead just
call the same inline function which will return the status of the inputs.

Signed-off-by: Joseph A. Lutz <joseph.lutz@novatechweb.com>
Fix sending the same change twice

When a line toggles faster than the usb message can be requested, only
the first change is storred. All subsequent changes op to when the usb
message is sent will be ignored.
This fixes the case where we read a change, ignore the next change, and
then recorde the change after that. This case would cause two usb
messages showing the same change occured twice.

Signed-off-by: Joseph A. Lutz <joseph.lutz@novatechweb.com>
Change the USB message API

Added to the functionality of the outputs. This requires changing how
the controll messages work. You can no longer change all the outputs at
once. They must be changed one at a time. The relay enable/disable has
it's own controll message. The wIndex is used to indicate which outputs
is being changed. The wValue is no longer a bitmast of the outputs state
but indicates weather to change the output on(!=0) or off(==0). The
output change control message must also contain 4 bytes of data. The
data is a delay time inmilliseconds. After the output state is changed a
timer is set to delay. After the delay expires the output will change to
to the opposite state of what was sent in the message.

Signed-off-by: Joseph A. Lutz <joseph.lutz@novatechweb.com>
Add control to get status of output timers

Signed-off-by: Joseph A. Lutz <joseph.lutz@novatechweb.com>
Add the ability to generate dissasembly files for debugging

Signed-off-by: Joseph A. Lutz <joseph.lutz@novatechweb.com>
Use UNUSED() and __attribute__((unused))

No longer casting the variable to void just to avoid compiler errors

Signed-off-by: Joseph A. Lutz <joseph.lutz@novatechweb.com>
Cleanup the debug pins

Use the unused pins on portA for debug pins only if DEBUG is defined

Signed-off-by: Joseph A. Lutz <joseph.lutz@novatechweb.com>
Fix issue with reloading an nt_timer

One-shot timers worked fine but timers that would reload did not work
properly. When a reloadable timer timmed out the function fould be
called multiple times untill the next timer tick.
Now the timer will reload as soon as it hits 0.

Signed-off-by: Joseph A. Lutz <joseph.lutz@novatechweb.com>
Fix I2C init and timming calculations

Signed-off-by: Joseph A. Lutz <joseph.lutz@novatechweb.com>
changed I2C_LED hardware (PCA8574D -> PCA8575PW)

Requirement was added to display the relay sense for the outputs on the
I2C LEDs. This required a different I2C IO Expander that has more IO
lines.

While making this change I made other changes to the code for the I2C
LEDs.
* stop using the systic interrupt
* use a nt_timer in place of the systic interrupt
* Have the I2C hardware use DMA

DMA was needed since more than two bytes were being transmitted. This
would decreas the number of interrupts generated by the I2C hardware.

Signed-off-by: Joseph A. Lutz <joseph.lutz@novatechweb.com>
Fix up the interrupt priorities

Signed-off-by: Joseph A. Lutz <joseph.lutz@novatechweb.com>