fix lua CAN RX of 11b frames (#4321)

* s

* loggy the change
This commit is contained in:
Matthew Kennedy 2022-07-05 10:37:31 -07:00 committed by GitHub
parent 09986f22eb
commit dec3021c8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -23,6 +23,11 @@ Release template (copy/paste this for new release):
# Changelog
## Unreleased
### Fixed
- Lua CAN reception fixed for 11-bit IDs where the frame would be received, but a corrupt ID was passed to the handler function. #4321
## July 2022 Release - "Day 130"
### Added

View File

@ -12,7 +12,7 @@ int32_t luaCanRxIds[maxFilterCount] = {0};
static bool shouldRxCanFrame(const CANRxFrame& frame) {
for (size_t i = 0; i < filterCount; i++) {
int32_t id = luaCanRxIds[i];
if (CAN_SID(frame) == id || CAN_EID(frame) == id) {
if (CAN_ID(frame) == id) {
return true;
}
}
@ -78,7 +78,7 @@ static void handleCanFrame(LuaHandle& ls, CanFrameData* data) {
// Push bus, ID and DLC
lua_pushinteger(ls, data->BusIndex); // TODO: support multiple busses!
lua_pushinteger(ls, CAN_EID(data->Frame));
lua_pushinteger(ls, CAN_ID(data->Frame));
lua_pushinteger(ls, dlc);
// Build table for data