Make the modules transfer a module protocol version composed of a major, a minor and a patch number.
This commit is contained in:
@@ -10,10 +10,17 @@
|
||||
#include "bool_array_converter.h"
|
||||
#include "bootloader.h"
|
||||
#include "module.h"
|
||||
#include "versions.h"
|
||||
|
||||
i2c_message_t RxMessage;
|
||||
i2c_message_t TxMessage;
|
||||
|
||||
static version_t moduleProtocolVersion = {
|
||||
MODULE_PROTOCOL_MAJOR_VERSION,
|
||||
MODULE_PROTOCOL_MINOR_VERSION,
|
||||
MODULE_PROTOCOL_PATCH_VERSION,
|
||||
};
|
||||
|
||||
void SlaveRxHandler(void)
|
||||
{
|
||||
if (!CRC16_IsMessageValid(&RxMessage)) {
|
||||
@@ -57,7 +64,7 @@ void SlaveTxHandler(void)
|
||||
break;
|
||||
}
|
||||
case SlaveProperty_ModuleProtocolVersion: {
|
||||
TxMessage.data[0] = MODULE_PROTOCOL_VERSION;
|
||||
memcpy(TxMessage.data, &moduleProtocolVersion, sizeof(version_t));
|
||||
TxMessage.length = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user