parent
bd1a4bb135
commit
d381701e4e
|
@ -45,6 +45,7 @@ DDEFS += -DOPENBLT_CAN_TX_PIN=1
|
|||
DDEFS += -DHW_PROTEUS=1
|
||||
|
||||
ifeq ($(PROJECT_CPU),ARCH_STM32F7)
|
||||
DDEFS += -DLUA_RX_MAX_FILTER_COUNT=96
|
||||
DDEFS += -DSTATIC_BOARD_ID=STATIC_BOARD_ID_PROTEUS_F7
|
||||
|
||||
ifeq ($(EFI_LUA_LOOKUP),)
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
#include "can_filter.h"
|
||||
#include "can_hw.h"
|
||||
|
||||
static constexpr size_t maxFilterCount = 48;
|
||||
#ifndef LUA_RX_MAX_FILTER_COUNT
|
||||
#define LUA_RX_MAX_FILTER_COUNT 48
|
||||
#endif
|
||||
|
||||
static size_t filterCount = 0;
|
||||
static CanFilter filters[maxFilterCount];
|
||||
static CanFilter filters[LUA_RX_MAX_FILTER_COUNT];
|
||||
|
||||
CanFilter* getFilterForId(size_t busIndex, int Id) {
|
||||
for (size_t i = 0; i < filterCount; i++) {
|
||||
|
@ -27,7 +29,7 @@ void resetLuaCanRx() {
|
|||
}
|
||||
|
||||
void addLuaCanRxFilter(int32_t eid, uint32_t mask, int bus, int callback) {
|
||||
if (filterCount >= maxFilterCount) {
|
||||
if (filterCount >= LUA_RX_MAX_FILTER_COUNT) {
|
||||
criticalError("Too many Lua CAN RX filters");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue