1
0
mirror of https://github.com/preble/libpinproc synced 2026-02-24 18:25:23 +01:00

pinproctest: code cleanup

Includes check to limit accelerometer-related code to P3-ROC since
it fails on the P-ROC (which doesn't have an accelerometer).
This commit is contained in:
Tom Collins
2020-06-25 23:28:13 -07:00
committed by Gerry Stellenberg
parent b2d9b4e000
commit 954084d348
3 changed files with 64 additions and 57 deletions

View File

@@ -151,7 +151,7 @@ void LoadSwitchStates( PRHandle proc )
// Get all of the switch states from the P-ROC.
if (PRSwitchGetStates( proc, procSwitchStates, kPRSwitchPhysicalLast + 1 ) == kPRFailure)
{
fprintf(stderr, "Error: Unable to retrieve switch states\n");
printf("Error: Unable to retrieve switch states\n");
}
else
{
@@ -162,17 +162,15 @@ void LoadSwitchStates( PRHandle proc )
}
int zero = 0;
fprintf(stderr, "\nCurrent Switch States: %3d : ", zero);
for (i = 0; i < kPRSwitchPhysicalLast + 1; i++)
{
fprintf(stderr, "%d ", switches[i].state);
if ((i + 1) % 32 == 0)
{
if (i % 32 == 0) {
printf("\n");
if (i != kPRSwitchPhysicalLast)
fprintf(stderr, "Current Switch States: %3d : ", i+1);
printf("Current Switch States: %3d: ", i);
}
printf("%d", switches[i].state);
}
fprintf(stderr, "\n");
printf("\n");
}
}