MCPcopy Create free account
hub / github.com/PowerBroker2/DFPlayerMini_Fast / findChecksum

Method findChecksum

src/DFPlayerMini_Fast.cpp:908–914  ·  view source on GitHub ↗

/ ! @brief Determine and insert the checksum of a given config/command packet into that same packet struct. @param _stack Reference to a struct containing the config/command packet to calculate the checksum over. */ /

Source from the content-addressed store, hash-verified

906 */
907 /**************************************************************************/
908void DFPlayerMini_Fast::findChecksum(stack& _stack)
909{
910 int16_t checksum = 0 - (_stack.version + _stack.length + _stack.commandValue + _stack.feedbackValue + _stack.paramMSB + _stack.paramLSB);
911
912 _stack.checksumMSB = checksum >> 8;
913 _stack.checksumLSB = checksum & 0x00FF;
914}
915
916
917

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected