RobTillaart / CRC

CRC library for Arduino
MIT License
79 stars 17 forks source link

Add constructors with all parameters at once #25

Closed RobTillaart closed 2 years ago

RobTillaart commented 2 years ago

now you have to do

  CRC16 crc;
  crc.setPolynome(0x1021);
  crc.setStartXOR(0xFFFF);
  crc.setEndXOR(0xFFFF);
  crc.setReverseIn(true);
  crc.setReverseOut(true);

it would be easier if one had a constructor like

  CRC16 crc(0x1021, 0xFFFF, 0xFFFF, true, true);
RobTillaart commented 2 years ago

one side effect is that a call to reset() would overrule the initial settings with sort of "factory defaults". But that is also true when settings are changed, so no show stopper imho.

RobTillaart commented 2 years ago

Create tests ?