mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Fixes SPI bad chip select (#818)
Temporary workaround for 2018v13 image.
This commit is contained in:
committed by
Peter Johnson
parent
8106fbdbea
commit
b42285fddd
@@ -99,6 +99,15 @@ void initializeDigital(int32_t* status) {
|
||||
// SPI setup
|
||||
spiSystem.reset(tSPI::create(status));
|
||||
|
||||
// Image 13 requires a SPI select and a strobe to enable SPI CS on MXP.
|
||||
// Switch to SPI 1, strobe the signal, and then switch back to previous.
|
||||
bool existingSelect = spiSystem->readAutoSPI1Select(status);
|
||||
spiSystem->writeAutoSPI1Select(true, status);
|
||||
spiSystem->strobeAutoForceOne(status);
|
||||
// Delay enough time to actually trigger strobe
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
spiSystem->writeAutoSPI1Select(existingSelect, status);
|
||||
|
||||
digitalSystemsInitialized = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user