Topic: tech dcc pc src prev next

tech dcc pc src > debounce.c

#include "debounce.h"

unsigned char Debounce_CountBits(unsigned char in)
{
    const unsigned long long int conversion = 0x4332322132212110;
    return (unsigned char)(
      ((conversion >> (4 * (in & 0x0f))) & 0x0f) +
      ((conversion >> (4 * ((in & 0xf0) >> 4))) & 0x0f)
      );
}