You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.
because it produces error: ...libraries/Bridge/src/Bridge.cpp:121:33: error: '_crc_ccitt_update' was not declared in this scope
For some reason, it works if you comment out ModbusMaster.h, compile the code and then uncomment the ModbusMaster.h and recompile again. But this is not a clear solution, because a lot of code depends on modbus library (you have to comment out whole project then). Let's go for a real solution:
Bridge.cpp:105 is checking ARDUINO_ARCH_AVR:
#if defined(ARDUINO_ARCH_AVR)
#include <util/crc16.h> // AVR use an optimized implementation of CRC
#else
uint16_t _crc_ccitt_update(uint16_t crc, uint8_t data) // Generic implementation for non-AVR architectures
{
...
#endif
With locate and grep I've checked which util/crc16.h contains _crc_ccitt_update() and this function is not found in .../Arduino/libraries/ModbusMaster/src/util/crc16.h. This file just adds crc16_update() in case if _UTIL_CRC16_H_ is not defined but it is not regular crc16.h replacement but somehow prefered during the compilation. Probably @4-20ma should consider this as an issue.
Solution: (hotfix) rename util/crc16.h to something like crc16_.h and modify also ModbusMaster.h:58
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When i use #include <ModbusMaster.h> from ModbusMaster v2.0.1 sctach does not compile
#include <Bridge.h>
#include <BridgeServer.h>
#include <BridgeClient.h>
#include <ModbusMaster.h>
i got this error:
C:\Program Files (x86)\Arduino\libraries\Bridge\src\Bridge.cpp: In member function 'void BridgeClass::crcUpdate(uint8_t)':
C:\Program Files (x86)\Arduino\libraries\Bridge\src\Bridge.cpp:121:33: error: '_crc_ccitt_update' was not declared in this scope
CRC = _crc_ccitt_update(CRC, c);
i appreciate any sloution
The text was updated successfully, but these errors were encountered: