src/slcan_encode.c
/**
 * Parses a single text digit and returns the value
 * 
 * @param digit The character to encode
 * 
 * @return The value of the digit encoded
 */
Parses a single text digit and returns the value

@param digit The character to encode

@return The value of the digit encoded
Parses a single text digit and returns the value @param digit The character to encode @return The value of the digit encoded
uint8_t encodeDigit(uint8_t digit)
{
    digit &= 0xF;
    if (digit < 10) {
        return digit + '0';
    }
    return digit + 'A' - 10;
}
uint8_t encodeDigit ( uint8_t digit ) { digit &= 0xF ; if ( digit < 10 ) { return digit + ' ' ; } return digit + ' ' - 10 ; }
Parses a single text digit and returns the value
Parses a single text digit and returns the value