Check external NRF crc

This commit is contained in:
Benjamin Vedder 2021-06-27 13:02:24 +02:00
parent ff94d2481a
commit b7a5ff5a1b
2 changed files with 10 additions and 2 deletions

View File

@ -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: {

View File

@ -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"