src/patch.c
__attribute__((at(0x00218E00, "", CHIP_VER_BCM4375B1_BT, FW_VER_S20)))
unsigned short crc16(uint8_t *ptr, int count)
{
   int  crc;
   uint8_t i;
   crc = 0;
   while (--count >= 0)
   {
      crc = crc ^ (int) *ptr++ << 8;
      i = 8;
      do
      {
         if (crc & 0x8000)
            crc = crc << 1 ^ 0x1021;
         else
            crc = crc << 1;
      } while(--i);
   }
   return (crc);
}
/* 
Function allowing to calculate a Mosart CRC
*/
Function allowing to calculate a Mosart CRC
Function allowing to calculate a Mosart CRC
__attribute__((at(0x00218E00, "", CHIP_VER_BCM4375B1_BT, FW_VER_S20)))
unsigned short crc16(uint8_t *ptr, int count)
{
   int  crc;
   uint8_t i;
   crc = 0;
   while (--count >= 0)
   {
      crc = crc ^ (int) *ptr++ << 8;
      i = 8;
      do
      {
         if (crc & 0x8000)
            crc = crc << 1 ^ 0x1021;
         else
            crc = crc << 1;
      } while(--i);
   }
   return (crc);
}
__attribute__ ( ( at ( 0x00218E00 , " " , CHIP_VER_BCM4375B1_BT , FW_VER_S20 ) ) ) unsigned short crc16 ( uint8_t * ptr , int count ) { int crc ; uint8_t i ; crc = 0 ; while ( -- count >= 0 ) { crc = crc ^ ( int ) * ptr ++ << 8 ; i = 8 ; do { if ( crc & 0x8000 ) crc = crc << 1 ^ 0x1021 ; else crc = crc << 1 ; } while ( -- i ) ; } return ( crc ) ; }
Function allowing to calculate a Mosart CRC
Function allowing to calculate a Mosart CRC