Open
Description
I don't have a test case so I'm not 100% positive on these, hence questions rather than statements.
allwpilib/hal/src/main/native/athena/I2C.cpp
Line 184 in 11fb0a4
It looks like the highlighted code should be a pre-decrement, or maybe a compare against 1 instead of 0? Same potential issue with the case for the onboard port.
Also, should the HAL_FreeDIOPort() calls be inside the if() block here - seems like releasing them when objCount>0 might be wrong.
Might also be good to have a check that count isn't already 0 before decrementing?