AP_UAVCAN: fixed build error of F4 boards with CAN

This commit is contained in:
Andrew Tridgell 2019-06-02 17:38:25 +10:00
parent c61412d2d1
commit 4a8c307720
1 changed files with 7 additions and 7 deletions

View File

@ -39,7 +39,7 @@ static uint8_t nibble2hex(uint8_t x)
static bool hex2nibble_error;
static uint8_t hex2nibble(char ch)
static uint8_t hex2nibble(char c)
{
// Must go into RAM, not flash, because flash is slow
static uint8_t NumConversionTable[] = {
@ -52,14 +52,14 @@ static uint8_t hex2nibble(char ch)
uint8_t out = 255;
if (ch >= '0' && ch <= '9') {
out = NumConversionTable[int(ch) - int('0')];
if (c >= '0' && c <= '9') {
out = NumConversionTable[int(c) - int('0')];
}
else if (ch >= 'a' && ch <= 'f') {
out = AlphaConversionTable[int(ch) - int('a')];
else if (c >= 'a' && c <= 'f') {
out = AlphaConversionTable[int(c) - int('a')];
}
else if (ch >= 'A' && ch <= 'F') {
out = AlphaConversionTable[int(ch) - int('A')];
else if (c >= 'A' && c <= 'F') {
out = AlphaConversionTable[int(c) - int('A')];
}
if (out == 255) {