Skip to content

Commit a8c6b3c

Browse files
committed
Avoid compiler warnings
1 parent 020aeee commit a8c6b3c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/IridiumSBD.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ int IridiumSBD::internalSendReceiveSBD(const char *txTxtMessage, const uint8_t *
741741
diagprint(moCode);
742742
diagprint(F("\r\n"));
743743

744-
if (moCode >= 0 && moCode <= 4) // this range indicates successful return!
744+
if (moCode <= 4) // this range indicates successful return!
745745
{
746746
diagprint(F("SBDIX success!\r\n"));
747747

@@ -1393,7 +1393,7 @@ void IridiumSBD::check9603data()
13931393
wireport->beginTransmission((uint8_t)deviceaddress); // Talk to the I2C device
13941394
wireport->write(LEN_REG); // Point to the serial buffer length
13951395
wireport->endTransmission(); // Send data and release the bus (the 841 (WireS) doesn't like it if the Master holds the bus!)
1396-
if (wireport->requestFrom((uint8_t)deviceaddress, 2) == 2) // Request two bytes
1396+
if (wireport->requestFrom((uint8_t)deviceaddress, (uint8_t)2) == 2) // Request two bytes
13971397
{
13981398
uint8_t msb = wireport->read();
13991399
uint8_t lsb = wireport->read();
@@ -1411,14 +1411,14 @@ void IridiumSBD::check9603data()
14111411
wireport->endTransmission(); // Send data and release the bus (the 841 (WireS) doesn't like it if the Master holds the bus!)
14121412
while (bytesAvailable > SER_PACKET_SIZE) // If there are _more_ than SER_PACKET_SIZE bytes to be read
14131413
{
1414-
wireport->requestFrom((uint8_t)deviceaddress, SER_PACKET_SIZE, false); // Request SER_PACKET_SIZE bytes, don't release the bus
1414+
wireport->requestFrom((uint8_t)deviceaddress, (uint8_t)SER_PACKET_SIZE, (uint8_t)false); // Request SER_PACKET_SIZE bytes, don't release the bus
14151415
while (wireport->available())
14161416
{
14171417
i2cSerPoke(wireport->read()); // Read and store each byte
14181418
}
14191419
bytesAvailable -= SER_PACKET_SIZE; // Decrease the number of bytes available by SER_PACKET_SIZE
14201420
}
1421-
wireport->requestFrom((uint8_t)deviceaddress, bytesAvailable); // Request remaining bytes, release the bus
1421+
wireport->requestFrom((uint8_t)deviceaddress, (uint8_t)bytesAvailable); // Request remaining bytes, release the bus
14221422
while (wireport->available())
14231423
{
14241424
i2cSerPoke(wireport->read()); // Read and store each byte
@@ -1436,7 +1436,7 @@ void IridiumSBD::check9603pins()
14361436
wireport->beginTransmission((uint8_t)deviceaddress); // Talk to the I2C device
14371437
wireport->write(IO_REG); // Point to the 'IO register'
14381438
wireport->endTransmission(); // Send data and release the bus (the 841 (WireS) doesn't like it if the Master holds the bus!)
1439-
if (wireport->requestFrom((uint8_t)deviceaddress, 1) == 1) // Request one byte from the IO register
1439+
if (wireport->requestFrom((uint8_t)deviceaddress, (uint8_t)1) == 1) // Request one byte from the IO register
14401440
{
14411441
IO_REGISTER = wireport->read(); // Read the IO register
14421442
}
@@ -1466,7 +1466,7 @@ int IridiumSBD::internalPassThruI2Cread(uint8_t *rxBuffer, size_t &rxBufferSize,
14661466
wireport->beginTransmission((uint8_t)deviceaddress); // Talk to the I2C device
14671467
wireport->write(LEN_REG); // Point to the serial buffer length
14681468
wireport->endTransmission(); // Send data and release the bus (the 841 (WireS) doesn't like it if the Master holds the bus!)
1469-
if (wireport->requestFrom((uint8_t)deviceaddress, 2) == 2) // Request two bytes
1469+
if (wireport->requestFrom((uint8_t)deviceaddress, (uint8_t)2) == 2) // Request two bytes
14701470
{
14711471
uint8_t msb = wireport->read();
14721472
uint8_t lsb = wireport->read();
@@ -1488,7 +1488,7 @@ int IridiumSBD::internalPassThruI2Cread(uint8_t *rxBuffer, size_t &rxBufferSize,
14881488
wireport->endTransmission(); // Send data and release the bus (the 841 (WireS) doesn't like it if the Master holds the bus!)
14891489
while (bytesAvailable > SER_PACKET_SIZE) // If there are _more_ than SER_PACKET_SIZE bytes to be read
14901490
{
1491-
wireport->requestFrom((uint8_t)deviceaddress, SER_PACKET_SIZE, false); // Request SER_PACKET_SIZE bytes, don't release the bus
1491+
wireport->requestFrom((uint8_t)deviceaddress, (uint8_t)SER_PACKET_SIZE, (uint8_t)false); // Request SER_PACKET_SIZE bytes, don't release the bus
14921492
while (wireport->available())
14931493
{
14941494
uint8_t dbyte = wireport->read(); // Read a byte
@@ -1500,7 +1500,7 @@ int IridiumSBD::internalPassThruI2Cread(uint8_t *rxBuffer, size_t &rxBufferSize,
15001500
}
15011501
bytesAvailable -= SER_PACKET_SIZE; // Decrease the number of bytes available by SER_PACKET_SIZE
15021502
}
1503-
wireport->requestFrom((uint8_t)deviceaddress, bytesAvailable); // Request remaining bytes, release the bus
1503+
wireport->requestFrom((uint8_t)deviceaddress, (uint8_t)bytesAvailable); // Request remaining bytes, release the bus
15041504
while (wireport->available())
15051505
{
15061506
uint8_t dbyte = wireport->read(); // Read a byte

0 commit comments

Comments
 (0)