Skip to content

Commit

Permalink
Merge pull request #439 from ut-issl/feature/enable_crc_ccitt_right
Browse files Browse the repository at this point in the history
CCITT Right の CRC を有効化
  • Loading branch information
meltingrabbit authored Oct 1, 2022
2 parents 74b2320 + a5a03c9 commit afb6a07
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
4 changes: 0 additions & 4 deletions Library/crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ static const uint16_t CRC_kCrc16CcittLeftTable_[256] = {
0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0
};

#if 0
static const uint16_t CRC_kCrc16CcittRightTable_[256] = {
0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
Expand Down Expand Up @@ -110,7 +109,6 @@ static const uint16_t CRC_kCrc16CcittRightTable_[256] = {
0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
};
#endif

uint16_t CRC_calc_crc_16_ibm_right(uint16_t crc, const uint8_t* c, size_t n, int rev_flag)
{
Expand Down Expand Up @@ -138,7 +136,6 @@ uint16_t CRC_calc_crc_16_ccitt_left(uint16_t crc, const uint8_t* c, size_t n, in
else return crc;
}

#if 0
uint16_t CRC_calc_crc_16_ccitt_right(uint16_t crc, const uint8_t* c, size_t n, int rev_flag)
{
size_t i;
Expand All @@ -151,7 +148,6 @@ uint16_t CRC_calc_crc_16_ccitt_right(uint16_t crc, const uint8_t* c, size_t n, i
if (rev_flag) return (uint16_t)~crc;
else return crc;
}
#endif

void CRC_make_crc_8_table(uint8_t* table, uint8_t crc_poly, uint8_t shift)
{
Expand Down
3 changes: 0 additions & 3 deletions Library/crc.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ uint16_t CRC_calc_crc_16_ibm_right(uint16_t crc, const uint8_t* c, size_t n, int
*/
uint16_t CRC_calc_crc_16_ccitt_left(uint16_t crc, const uint8_t* c, size_t n, int rev_flag);

// 右送りの CCITT は一般的ではないこと, table でメモリを使うので,一旦無効化
#if 0
/**
* @brief CRC-16-CCITT
*
Expand All @@ -51,7 +49,6 @@ uint16_t CRC_calc_crc_16_ccitt_left(uint16_t crc, const uint8_t* c, size_t n, in
* @return uint16_t: 計算結果
*/
uint16_t CRC_calc_crc_16_ccitt_right(uint16_t crc, const uint8_t* c, size_t n, int rev_flag);
#endif

/**
* @brief crc用のテーブル作成
Expand Down

0 comments on commit afb6a07

Please sign in to comment.