4 ms·
The latest commit message on that file is "Changed lfs_crc to match more common API (...)" so I would assume that they factored out this function specifically s
by TonyTrapp 5y ago
The latest commit message on that file is "Changed lfs_crc to match more common API (...)" so I would assume that they factored out this function specifically so that it could be easily exchanged with another implementation. There are many CRC32 implementations that may be more suitable for the specific microcontroller you are targetting, or maybe you already have an CRC32 implementation in your codebase that you would like to reuse because space is scarce. For the other functions the reusability isn't really given.
- magicalhippo 5y agoAs an example, most if not all STM32's have CRC32 hardware as well, so by pulling it out one can use such a hardware implementation.
- NonEUCitizen 5y agoThey could've put an ifdef/#ifndef around it and not have an extra file.
- SteveMoody73 5y agoYou could do that but if you want to support a lot of different microcontrollers which may all have different implementations, separating the code into a different file makes more sense. Even if you add ifdef statements for every supported controller in there and the file becomes a mess of conditional code, you still have a clean implementation of the file system.
- deleted 5y ago[deleted]