@@ -58,8 +58,8 @@ STATIC void static_assertions(void) {
5858 MP_STATIC_ASSERT (CAN_XIDFE_0_EFEC_STF0M_Val + 1 == CAN_XIDFE_0_EFEC_STF1M_Val );
5959}
6060
61- STATIC bool single_address_filter (canio_match_obj_t * match ) {
62- return match -> mask == 0 || match -> mask == match -> address ;
61+ STATIC bool single_id_filter (canio_match_obj_t * match ) {
62+ return match -> mask == 0 || match -> mask == match -> id ;
6363}
6464
6565STATIC bool standard_filter_in_use (CanMramSidfe * filter ) {
@@ -76,7 +76,7 @@ STATIC size_t num_filters_needed(size_t nmatch, canio_match_obj_t **matches, boo
7676 if (extended != matches [i ]-> extended ) {
7777 continue ;
7878 }
79- if (single_address_filter (matches [i ])) {
79+ if (single_id_filter (matches [i ])) {
8080 num_half_filters_needed += 1 ;
8181 } else {
8282 num_half_filters_needed += 2 ;
@@ -191,7 +191,7 @@ STATIC void install_extended_filter(CanMramXidfe *extended, int id1, int id2, in
191191}
192192
193193
194- #define NO_ADDRESS (-1)
194+ #define NO_ID (-1)
195195void set_filters (canio_listener_obj_t * self , size_t nmatch , canio_match_obj_t * * matches ) {
196196 int fifo = self -> fifo_idx ;
197197
@@ -207,31 +207,31 @@ void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **
207207 CanMramSidfe * standard = next_standard_filter (self , NULL );
208208 CanMramXidfe * extended = next_extended_filter (self , NULL );
209209
210- int first_address = NO_ADDRESS ;
210+ int first_id = NO_ID ;
211211
212- // step 1: single address standard matches
212+ // step 1: single id standard matches
213213 // we have to gather up pairs and stuff them in a single filter entry
214214 for (size_t i = 0 ; i < nmatch ; i ++ ) {
215215 canio_match_obj_t * match = matches [i ];
216216 if (match -> extended ) {
217217 continue ;
218218 }
219- if (!single_address_filter (match )) {
219+ if (!single_id_filter (match )) {
220220 continue ;
221221 }
222- if (first_address != NO_ADDRESS ) {
223- install_standard_filter (standard , first_address , match -> address , CAN_SIDFE_0_SFEC_STF0M_Val + fifo , CAN_SIDFE_0_SFT_DUAL_Val );
224- first_address = NO_ADDRESS ;
222+ if (first_id != NO_ID ) {
223+ install_standard_filter (standard , first_id , match -> id , CAN_SIDFE_0_SFEC_STF0M_Val + fifo , CAN_SIDFE_0_SFT_DUAL_Val );
224+ first_id = NO_ID ;
225225 standard = next_standard_filter (self , standard );
226226 } else {
227- first_address = match -> address ;
227+ first_id = match -> id ;
228228 }
229229 }
230- // step 1.5. odd single address standard match
231- if (first_address != NO_ADDRESS ) {
232- install_standard_filter (standard , first_address , first_address , CAN_SIDFE_0_SFEC_STF0M_Val + fifo , CAN_SIDFE_0_SFT_DUAL_Val );
230+ // step 1.5. odd single id standard match
231+ if (first_id != NO_ID ) {
232+ install_standard_filter (standard , first_id , first_id , CAN_SIDFE_0_SFEC_STF0M_Val + fifo , CAN_SIDFE_0_SFT_DUAL_Val );
233233 standard = next_standard_filter (self , standard );
234- first_address = NO_ADDRESS ;
234+ first_id = NO_ID ;
235235 }
236236
237237 // step 2: standard mask filter
@@ -240,36 +240,36 @@ void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **
240240 if (match -> extended ) {
241241 continue ;
242242 }
243- if (single_address_filter (match )) {
243+ if (single_id_filter (match )) {
244244 continue ;
245245 }
246- install_standard_filter (standard , match -> address , match -> mask , CAN_SIDFE_0_SFEC_STF0M_Val + fifo , CAN_SIDFE_0_SFT_CLASSIC_Val );
246+ install_standard_filter (standard , match -> id , match -> mask , CAN_SIDFE_0_SFEC_STF0M_Val + fifo , CAN_SIDFE_0_SFT_CLASSIC_Val );
247247 standard = next_standard_filter (self , standard );
248248 }
249249
250- // step 3: single address extended matches
250+ // step 3: single id extended matches
251251 // we have to gather up pairs and stuff them in a single filter entry
252252 for (size_t i = 0 ; i < nmatch ; i ++ ) {
253253 canio_match_obj_t * match = matches [i ];
254254 if (!match -> extended ) {
255255 continue ;
256256 }
257- if (!single_address_filter (match )) {
257+ if (!single_id_filter (match )) {
258258 continue ;
259259 }
260- if (first_address != NO_ADDRESS ) {
261- install_extended_filter (extended , first_address , match -> address , CAN_XIDFE_0_EFEC_STF0M_Val + fifo , CAN_XIDFE_1_EFT_DUAL_Val );
262- first_address = NO_ADDRESS ;
260+ if (first_id != NO_ID ) {
261+ install_extended_filter (extended , first_id , match -> id , CAN_XIDFE_0_EFEC_STF0M_Val + fifo , CAN_XIDFE_1_EFT_DUAL_Val );
262+ first_id = NO_ID ;
263263 extended = next_extended_filter (self , extended );
264264 } else {
265- first_address = match -> address ;
265+ first_id = match -> id ;
266266 }
267267 }
268- // step 3.5. odd single address standard match
269- if (first_address != NO_ADDRESS ) {
270- install_extended_filter (extended , first_address , first_address , CAN_XIDFE_0_EFEC_STF0M_Val + fifo , CAN_XIDFE_1_EFT_DUAL_Val );
268+ // step 3.5. odd single id standard match
269+ if (first_id != NO_ID ) {
270+ install_extended_filter (extended , first_id , first_id , CAN_XIDFE_0_EFEC_STF0M_Val + fifo , CAN_XIDFE_1_EFT_DUAL_Val );
271271 extended = next_extended_filter (self , extended );
272- first_address = NO_ADDRESS ;
272+ first_id = NO_ID ;
273273 }
274274
275275 // step 4: extended mask filters
@@ -278,10 +278,10 @@ void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **
278278 if (!match -> extended ) {
279279 continue ;
280280 }
281- if (single_address_filter (match )) {
281+ if (single_id_filter (match )) {
282282 continue ;
283283 }
284- install_extended_filter (extended , match -> address , match -> mask , CAN_XIDFE_0_EFEC_STF0M_Val + fifo , CAN_XIDFE_1_EFT_CLASSIC_Val );
284+ install_extended_filter (extended , match -> id , match -> mask , CAN_XIDFE_0_EFEC_STF0M_Val + fifo , CAN_XIDFE_1_EFT_CLASSIC_Val );
285285 extended = next_extended_filter (self , extended );
286286 }
287287
@@ -363,7 +363,7 @@ bool common_hal_canio_listener_readinto(canio_listener_obj_t *self, canio_messag
363363 if (message -> extended ) {
364364 message -> id = hw_message -> rxf0 .bit .ID ;
365365 } else {
366- message -> id = hw_message -> rxf0 .bit .ID >> 18 ; // short addresses are left-justified
366+ message -> id = hw_message -> rxf0 .bit .ID >> 18 ; // short ids are left-justified
367367 }
368368 message -> rtr = hw_message -> rxf0 .bit .RTR ;
369369 message -> size = hw_message -> rxf1 .bit .DLC ;
0 commit comments