This is a fix to one of my edited/contributed features regarding compare-sections via qCRC.
There are three existing problems, which are not critical to upstream BMD here.
This PR updates crc32 dispatch code to deal with them.
Because of #1713 and requirements to support Windows and MacOS (cross-platform portable software), the __func__ portion of log became identical as collateral damage. This change restores the behaviour intended in #1708, so that we can tell apart speed reports from BMF+ENABLE_DEBUG and BMDA.
On out-of-tree platforms like Farpatch which use BMD as a git submodule directly, custom logger implementations format every DEBUG_INFO() call etc. by prepending loglevel and timestamp, so the 2-3 piece logmessage gets broken and mixed. This change buffers the optional output pieces into a zeroed stack buffer via snprintf() to avoid that.
Xtensa Farpatch crashes on every divide-by-zero, which can happen here when <1 milliseconds are reported elapsed by corresponding platform timing code. BMF on Cortex-M3 does not trap integer divide-by-zero into UsageFault, so it was never affected. BMDA usually gets more than 1ms due to USB FS delays and all the layer overheads. This change skips the speed report by checking for both length and time to be big enough.
Detailed description
compare-sections
viaqCRC
.__func__
portion of log became identical as collateral damage. This change restores the behaviour intended in #1708, so that we can tell apart speed reports from BMF+ENABLE_DEBUG
and BMDA.DEBUG_INFO()
call etc. by prepending loglevel and timestamp, so the 2-3 piece logmessage gets broken and mixed. This change buffers the optional output pieces into a zeroed stack buffer viasnprintf()
to avoid that.Your checklist for this pull request
Closing issues
Fixes some issues in Farpatch.