GCC Code Coverage Report


Directory: ./
File: firmware/controllers/lua/can_filter.h
Date: 2025-10-03 00:57:22
Coverage Exec Excl Total
Lines: 100.0% 2 0 2
Functions: 100.0% 1 0 1
Branches: -% 0 0 0
Decisions: -% 0 - 0

Line Branch Decision Exec Source
1 // can_filter.h
2
3 #pragma once
4
5 #define FILTER_SPECIFIC 0x1FFFFFFF
6 #define ANY_BUS -1
7 #define NO_CALLBACK -1
8
9 struct CanFilter {
10 int32_t Id;
11 int32_t Mask;
12
13 int Bus;
14 int Callback;
15
16 9 bool accept(int p_Id) {
17 9 return (p_Id & this->Mask) == Id;
18 }
19 };
20
21 // Called when the user script is unloaded, resets any CAN rx filters
22 void resetLuaCanRx();
23 // Adds a frame ID to listen to
24 void addLuaCanRxFilter(int32_t eid, uint32_t mask, int bus, int callback);
25
26 CanFilter* getFilterForId(size_t busIndex, int Id);
27