Skip to content

Commit

Permalink
Fix for compile error re: unsigned int #200
Browse files Browse the repository at this point in the history
  • Loading branch information
jimwhitelaw committed Jan 9, 2024
1 parent f920630 commit c0d0da3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ELMduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2689,7 +2689,7 @@ void ELM327::currentDTCCodes(const bool &isBlocking)
// Each response line will start with "43" indicating it is a response to a Mode 03 request.
// See p. 31 of ELM327 datasheet for details and lookup table of code types.

uint codesFound = strlen(payload) / 8; // Each code found returns 8 chars starting with "43"
uint8_t codesFound = strlen(payload) / 8; // Each code found returns 8 chars starting with "43"
idx = strstr(payload, "43") + 4; // Pointer to first DTC code digit (third char in the response)

if (codesFound > DTC_MAX_CODES) // I don't think the ELM is capable of returning
Expand Down
6 changes: 3 additions & 3 deletions src/ELMduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ const int8_t ELM_TIMEOUT = 7;
const int8_t ELM_GETTING_MSG = 8;
const int8_t ELM_MSG_RXD = 9;
const int8_t ELM_GENERAL_ERROR = -1;
const int8_t DTC_CODE_LEN = 6;
const int8_t DTC_MAX_CODES = 16;
const uint8_t DTC_CODE_LEN = 6;
const uint8_t DTC_MAX_CODES = 16;

// Non-blocking (NB) command states
typedef enum { SEND_COMMAND,
Expand Down Expand Up @@ -308,7 +308,7 @@ class ELM327
byte responseByte_7;

struct dtcResponse {
uint codesFound = 0;
uint8_t codesFound = 0;
char codes[DTC_MAX_CODES][DTC_CODE_LEN];
} DTC_Response;

Expand Down

0 comments on commit c0d0da3

Please sign in to comment.