Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/SoftIBus14m/SoftIBus14m.ino
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void setup()

void loop()
{
static int inibus;
static uint16_t inibus;
IBus.loop();
for (int i = 0; i < ch; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/SoftIBus14mTelemetry/SoftIBus14mTelemetry.ino
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void setup()

void loop()
{
static int inibus;
static uint16_t inibus;
IBus.loop();
for (int i = 0; i < ch; i++)
{
Expand Down
4 changes: 2 additions & 2 deletions src/SoftIBus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void SIBus::loop(void)
}
last = now;

uint16_t v = stream->read(); /* uint8_t v = stream->read(); */
uint8_t v = stream->read(); /* uint8_t v = stream->read(); */
switch (state)
{
case GET_LENGTH:
Expand Down Expand Up @@ -62,7 +62,7 @@ void SIBus::loop(void)

case GET_CHKSUMH:
// Validate checksum
if (chksum == (v << 8) + lchksum)
if (chksum == static_cast<uint16_t>(v << 8) + lchksum) //if (chksum == (v << 8) + lchksum)
{
// Execute command - we only know command 0x40
switch (buffer[0])
Expand Down