lib/RadioHead/RH_ASK.cpp
// Convert a 6 bit encoded symbol into its 4 bit decoded equivalent
Convert a 6 bit encoded symbol into its 4 bit decoded equivalent
Convert a 6 bit encoded symbol into its 4 bit decoded equivalent
uint8_t RH_INTERRUPT_ATTR RH_ASK::symbol_6to4(uint8_t symbol)
{
    uint8_t i;
    uint8_t count;
    for (i = (symbol>>2) & 8, count=8; count-- ; i++)
	if (symbol == symbols[i]) return i;
    return 0; 
}
uint8_t RH_INTERRUPT_ATTR RH_ASK :: symbol_6to4 ( uint8_t symbol ) { uint8_t i ; uint8_t count ; for ( i = ( symbol >> 2 ) & 8 , count = 8 ; count -- ; i ++ ) if ( symbol == symbols [ i ] ) return i ; return 0 ; }
Convert a 6 bit encoded symbol into its 4 bit decoded equivalent
Convert a 6 bit encoded symbol into its 4 bit decoded equivalent
// Linear search :-( Could have a 64 byte reverse lookup table? // There is a little speedup here courtesy Ralph Doncaster: // The shortcut works because bit 5 of the symbol is 1 for the last 8 // symbols, and it is 0 for the first 8. // So we only have to search half the table // Not found