Skip to content

Commit c1db2f5

Browse files
committed
Change _spiSpeed to uint32_t
1 parent bf7b291 commit c1db2f5

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/SparkFun_u-blox_GNSS_Arduino_Library.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -857,8 +857,7 @@ boolean SFE_UBLOX_GNSS::checkUbloxSpi(ubxPacket *incomingUBX, uint8_t requestedC
857857
//Note to future self: maybe we need the equivalent of "if (millis() - lastCheck >= i2cPollingWait)" here?
858858
//At the moment the code will pound the SPI bus while waiting for data...
859859

860-
SPISettings settingsA(_spiSpeed, MSBFIRST, SPI_MODE0);
861-
_spiPort->beginTransaction(settingsA);
860+
_spiPort->beginTransaction(SPISettings(_spiSpeed, MSBFIRST, SPI_MODE0));
862861
digitalWrite(_csPin, LOW);
863862
uint8_t byteReturned = _spiPort->transfer(0xFF);
864863
// Note to future self: I think the 0xFF check will cause problems when attempting to process (e.g.) RAWX data
@@ -2933,8 +2932,7 @@ void SFE_UBLOX_GNSS::sendSpiCommand(ubxPacket *outgoingUBX)
29332932
// Start at the beginning of the SPI buffer
29342933
spiBufferIndex = 0;
29352934

2936-
SPISettings settingsA(_spiSpeed, MSBFIRST, SPI_MODE0);
2937-
_spiPort->beginTransaction(settingsA);
2935+
_spiPort->beginTransaction(SPISettings(_spiSpeed, MSBFIRST, SPI_MODE0));
29382936
digitalWrite(_csPin, LOW);
29392937
//Write header bytes
29402938
spiTransfer(UBX_SYNCH_1); //μ - oh ublox, you're funny. I will call you micro-blox from now on.

src/SparkFun_u-blox_GNSS_Arduino_Library.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,7 @@ class SFE_UBLOX_GNSS
13031303

13041304
SPIClass *_spiPort; //The instance of SPIClass
13051305
uint8_t _csPin; //The chip select pin
1306-
int _spiSpeed; //The speed to use for SPI (Hz)
1306+
uint32_t _spiSpeed; //The speed to use for SPI (Hz)
13071307

13081308
uint8_t _gpsI2Caddress = 0x42; //Default 7-bit unshifted address of the ublox 6/7/8/M8/F9 series
13091309
//This can be changed using the ublox configuration software

0 commit comments

Comments
 (0)