src/patch.c
__attribute__((at(0x00218700, "", CHIP_VER_BCM4375B1_BT, FW_VER_S20)))
int hamming(uint8_t *demod_buffer,uint8_t *pattern) {
	int count = 0;
	for (int i=0;i<4;i++) {
		for (int j=0;j<8;j++) {
			if (((pattern[i] >> (7-j)) & 0x01) != (((demod_buffer[i] & (i==0 && j==0 ? 0x7F : 0xFF)) >> (7-j)) & 0x01)) {
				count++;
			}
		}
	}
	return count;
}
/*
Function allowing to return the hamming distance between two buffers
*/
Function allowing to return the hamming distance between two buffers
Function allowing to return the hamming distance between two buffers
__attribute__((at(0x00218700, "", CHIP_VER_BCM4375B1_BT, FW_VER_S20)))
int hamming(uint8_t *demod_buffer,uint8_t *pattern) {
	int count = 0;
	for (int i=0;i<4;i++) {
		for (int j=0;j<8;j++) {
			if (((pattern[i] >> (7-j)) & 0x01) != (((demod_buffer[i] & (i==0 && j==0 ? 0x7F : 0xFF)) >> (7-j)) & 0x01)) {
				count++;
			}
		}
	}
	return count;
}
__attribute__ ( ( at ( 0x00218700 , " " , CHIP_VER_BCM4375B1_BT , FW_VER_S20 ) ) ) int hamming ( uint8_t * demod_buffer , uint8_t * pattern ) { int count = 0 ; for ( int i = 0 ; i < 4 ; i ++ ) { for ( int j = 0 ; j < 8 ; j ++ ) { if ( ( ( pattern [ i ] >> ( 7 - j ) ) & 0x01 ) != ( ( ( demod_buffer [ i ] & ( i == 0 && j == 0 ? 0x7F : 0xFF ) ) >> ( 7 - j ) ) & 0x01 ) ) { count ++ ; } } } return count ; }
Function allowing to return the hamming distance between two buffers
Function allowing to return the hamming distance between two buffers