Improve performance when reading sectors (#1344)

This commit is contained in:
Uwe Seimet 2023-11-15 07:44:46 +01:00 committed by Daniel Markstedt
parent 208b459849
commit d1166ce13e

View File

@ -606,42 +606,31 @@ uint8_t GPIOBUS_Raspberry::GetDAT()
return (uint8_t)data; return (uint8_t)data;
} }
//---------------------------------------------------------------------------
//
// Set data signals
//
//---------------------------------------------------------------------------
void GPIOBUS_Raspberry::SetDAT(uint8_t dat) void GPIOBUS_Raspberry::SetDAT(uint8_t dat)
{ {
// Write to port // Write to ports
#if SIGNAL_CONTROL_MODE == 0 #if SIGNAL_CONTROL_MODE == 0
uint32_t fsel = gpfsel[0]; uint32_t fsel = gpfsel[0];
fsel &= tblDatMsk[0][dat]; fsel &= tblDatMsk[0][dat];
fsel |= tblDatSet[0][dat]; fsel |= tblDatSet[0][dat];
if (fsel != gpfsel[0]) { gpfsel[0] = fsel;
gpfsel[0] = fsel; gpio[GPIO_FSEL_0] = fsel;
gpio[GPIO_FSEL_0] = fsel;
}
fsel = gpfsel[1]; fsel = gpfsel[1];
fsel &= tblDatMsk[1][dat]; fsel &= tblDatMsk[1][dat];
fsel |= tblDatSet[1][dat]; fsel |= tblDatSet[1][dat];
if (fsel != gpfsel[1]) { gpfsel[1] = fsel;
gpfsel[1] = fsel; gpio[GPIO_FSEL_1] = fsel;
gpio[GPIO_FSEL_1] = fsel;
}
fsel = gpfsel[2]; fsel = gpfsel[2];
fsel &= tblDatMsk[2][dat]; fsel &= tblDatMsk[2][dat];
fsel |= tblDatSet[2][dat]; fsel |= tblDatSet[2][dat];
if (fsel != gpfsel[2]) { gpfsel[2] = fsel;
gpfsel[2] = fsel; gpio[GPIO_FSEL_2] = fsel;
gpio[GPIO_FSEL_2] = fsel;
}
#else #else
gpio[GPIO_CLR_0] = tblDatMsk[dat]; gpio[GPIO_CLR_0] = tblDatMsk[dat];
gpio[GPIO_SET_0] = tblDatSet[dat]; gpio[GPIO_SET_0] = tblDatSet[dat];
#endif // SIGNAL_CONTROL_MODE #endif
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------