src/slcan_decode.c
/**
 * Parses a single text digit and returns the value
 * 
 * @param digit The character to decode
 * 
 * @return The value of the digit decoded
 */
Parses a single text digit and returns the value

@param digit The character to decode

@return The value of the digit decoded
Parses a single text digit and returns the value @param digit The character to decode @return The value of the digit decoded
uint8_t decodeDigit(uint8_t digit)
{
    if ((digit >= 'A') && (digit <= 'F')) {
        return digit - 'A' + 10;
    } else if ((digit >= 'a') && (digit <= 'f')) {
        return digit - 'a' + 10;
    } else if ((digit >= '0') && (digit <= '9')) {
        return digit - '0';
    }
    return 0;
}
uint8_t decodeDigit ( uint8_t digit ) { if ( ( digit >= ' ' ) && ( digit <= ' ' ) ) { return digit - ' ' + 10 ; } else if ( ( digit >= ' ' ) && ( digit <= ' ' ) ) { return digit - ' ' + 10 ; } else if ( ( digit >= ' ' ) && ( digit <= ' ' ) ) { return digit - ' ' ; } return 0 ; }
Parses a single text digit and returns the value
Parses a single text digit and returns the value
// Don't know what this is