mirror of https://github.com/rusefi/bldc.git
Check external NRF crc
This commit is contained in:
parent
ff94d2481a
commit
b7a5ff5a1b
10
commands.c
10
commands.c
|
@ -49,6 +49,7 @@
|
|||
#include "mempools.h"
|
||||
#include "bms.h"
|
||||
#include "qmlui.h"
|
||||
#include "crc.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
@ -1036,7 +1037,14 @@ void commands_process_packet(unsigned char *data, unsigned int len,
|
|||
} break;
|
||||
|
||||
case COMM_EXT_NRF_ESB_RX_DATA: {
|
||||
nrf_driver_process_packet(data, len);
|
||||
if (len > 2) {
|
||||
unsigned short crc = crc16((unsigned char*)data, len - 2);
|
||||
|
||||
if (crc == ((unsigned short) data[len - 2] << 8 |
|
||||
(unsigned short) data[len - 1])) {
|
||||
nrf_driver_process_packet(data, len);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
case COMM_APP_DISABLE_OUTPUT: {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#define FW_VERSION_MAJOR 5
|
||||
#define FW_VERSION_MINOR 03
|
||||
// Set to 0 for building a release and iterate during beta test builds
|
||||
#define FW_TEST_VERSION_NUMBER 41
|
||||
#define FW_TEST_VERSION_NUMBER 42
|
||||
|
||||
#include "datatypes.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue