Whichever one is chosen, there should be a table-free implementation for code size reasons. FWIW there are more crc implementations in the zmodem app: https://github.com/apache/incubator-nuttx-apps/blob/master/system/zmodem/host/crc16.c
From: Sebastien Lorquet <sebast...@lorquet.fr> Date: Friday, July 15, 2022 at 4:13 PM To: dev@nuttx.apache.org <dev@nuttx.apache.org> Subject: Re: CRC32 what gives? @Nathan: Yes, of course. @Alan: Of course not, the structure passed to init can be set up to describe the required algorithm. But the partial update situation can be useful for protocols where the message is fragmented (eg radio transceivers with short FIFOs), or where only some fields enter the crc (I have seen this happen several times). you cant call the global crc() function on several buffers in sequence if bits are inverted on crc output. Sebastien On 7/15/22 20:21, Nathan Hartman wrote: > On Fri, Jul 15, 2022 at 1:40 PM Alan Carvalho de Assis > <acas...@gmail.com> wrote: >> Hi Sebastien, I think we don't need these three functions for each >> CRC, just one like in the Linux kernel is enough: >> >> https://www.kernel.org/doc/htmldocs/kernel-api/API-crc-ccitt.html >> >> BR, >> >> Alan > > Could have one generic function and then thin wrappers that call it > with the correct parameters for different uses. > > Cheers, > Nathan