A slightly different way of saying the same thing.

I've changed to an if - else construct to make it easy to add in debugging print statements if needed.
This commit is contained in:
Michael Banther
2019-10-01 13:52:08 +01:00
parent d32235d0f0
commit 2fb0bdfcc2

View File

@@ -13,7 +13,12 @@ void UserReadHIDData( in port p_int, unsigned char hidData[ HID_DATA_SIZE ])
unsigned curr_val; unsigned curr_val;
p_int :> curr_val; p_int :> curr_val;
hidData[ 0 ] = ( curr_val == NDP10X_ASSERT_LEVEL ) ? HID_REPORT_INTERRUPT_ASSERTED : HID_REPORT_INTERRUPT_DEASSERTED;
if( curr_val == NDP10X_ASSERT_LEVEL ) {
hidData[ 0 ] = HID_REPORT_INTERRUPT_ASSERTED;
} else {
hidData[ 0 ] = HID_REPORT_INTERRUPT_DEASSERTED;
}
for( unsigned idx = 1; idx < HID_DATA_SIZE; ++idx ) { for( unsigned idx = 1; idx < HID_DATA_SIZE; ++idx ) {
hidData[ idx ] = 0U; hidData[ idx ] = 0U;