Skip to content

Commit

Permalink
Update signal table usage
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Nov 29, 2023
1 parent ea16539 commit 0e7702c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions cpp/buses/gpiobus_raspberry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,10 @@ bool GPIOBUS_Raspberry::Init(mode_e mode)
#endif

// Initialize all signals
for (int i = 0; SignalTable[i] >= 0; i++) {
int j = SignalTable[i];
PinSetSignal(j, false);
PinConfig(j, GPIO_INPUT);
PullConfig(j, pullmode);
for (const int signal : SignalTable) {
PinSetSignal(signal, false);
PinConfig(signal, GPIO_INPUT);
PullConfig(signal, pullmode);
}

// Set control signals
Expand Down Expand Up @@ -269,11 +268,10 @@ void GPIOBUS_Raspberry::CleanUp()
PinConfig(PIN_DTD, GPIO_INPUT);

// Initialize all signals
for (int i = 0; SignalTable[i] >= 0; i++) {
const int pin = SignalTable[i];
PinSetSignal(pin, OFF);
PinConfig(pin, GPIO_INPUT);
PullConfig(pin, GPIO_PULLNONE);
for (const int signal : SignalTable) {
PinSetSignal(signal, false);
PinConfig(signal, GPIO_INPUT);
PullConfig(signal, GPIO_PULLNONE);
}

// Set drive strength back to 8mA
Expand Down

0 comments on commit 0e7702c

Please sign in to comment.