@@ -58,8 +58,8 @@ STATIC void static_assertions(void) {
58
58
MP_STATIC_ASSERT (CAN_XIDFE_0_EFEC_STF0M_Val + 1 == CAN_XIDFE_0_EFEC_STF1M_Val );
59
59
}
60
60
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 ;
63
63
}
64
64
65
65
STATIC 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
76
76
if (extended != matches [i ]-> extended ) {
77
77
continue ;
78
78
}
79
- if (single_address_filter (matches [i ])) {
79
+ if (single_id_filter (matches [i ])) {
80
80
num_half_filters_needed += 1 ;
81
81
} else {
82
82
num_half_filters_needed += 2 ;
@@ -191,7 +191,7 @@ STATIC void install_extended_filter(CanMramXidfe *extended, int id1, int id2, in
191
191
}
192
192
193
193
194
- #define NO_ADDRESS (-1)
194
+ #define NO_ID (-1)
195
195
void set_filters (canio_listener_obj_t * self , size_t nmatch , canio_match_obj_t * * matches ) {
196
196
int fifo = self -> fifo_idx ;
197
197
@@ -207,31 +207,31 @@ void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **
207
207
CanMramSidfe * standard = next_standard_filter (self , NULL );
208
208
CanMramXidfe * extended = next_extended_filter (self , NULL );
209
209
210
- int first_address = NO_ADDRESS ;
210
+ int first_id = NO_ID ;
211
211
212
- // step 1: single address standard matches
212
+ // step 1: single id standard matches
213
213
// we have to gather up pairs and stuff them in a single filter entry
214
214
for (size_t i = 0 ; i < nmatch ; i ++ ) {
215
215
canio_match_obj_t * match = matches [i ];
216
216
if (match -> extended ) {
217
217
continue ;
218
218
}
219
- if (!single_address_filter (match )) {
219
+ if (!single_id_filter (match )) {
220
220
continue ;
221
221
}
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 ;
225
225
standard = next_standard_filter (self , standard );
226
226
} else {
227
- first_address = match -> address ;
227
+ first_id = match -> id ;
228
228
}
229
229
}
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 );
233
233
standard = next_standard_filter (self , standard );
234
- first_address = NO_ADDRESS ;
234
+ first_id = NO_ID ;
235
235
}
236
236
237
237
// step 2: standard mask filter
@@ -240,36 +240,36 @@ void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **
240
240
if (match -> extended ) {
241
241
continue ;
242
242
}
243
- if (single_address_filter (match )) {
243
+ if (single_id_filter (match )) {
244
244
continue ;
245
245
}
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 );
247
247
standard = next_standard_filter (self , standard );
248
248
}
249
249
250
- // step 3: single address extended matches
250
+ // step 3: single id extended matches
251
251
// we have to gather up pairs and stuff them in a single filter entry
252
252
for (size_t i = 0 ; i < nmatch ; i ++ ) {
253
253
canio_match_obj_t * match = matches [i ];
254
254
if (!match -> extended ) {
255
255
continue ;
256
256
}
257
- if (!single_address_filter (match )) {
257
+ if (!single_id_filter (match )) {
258
258
continue ;
259
259
}
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 ;
263
263
extended = next_extended_filter (self , extended );
264
264
} else {
265
- first_address = match -> address ;
265
+ first_id = match -> id ;
266
266
}
267
267
}
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 );
271
271
extended = next_extended_filter (self , extended );
272
- first_address = NO_ADDRESS ;
272
+ first_id = NO_ID ;
273
273
}
274
274
275
275
// step 4: extended mask filters
@@ -278,10 +278,10 @@ void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **
278
278
if (!match -> extended ) {
279
279
continue ;
280
280
}
281
- if (single_address_filter (match )) {
281
+ if (single_id_filter (match )) {
282
282
continue ;
283
283
}
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 );
285
285
extended = next_extended_filter (self , extended );
286
286
}
287
287
@@ -363,7 +363,7 @@ bool common_hal_canio_listener_readinto(canio_listener_obj_t *self, canio_messag
363
363
if (message -> extended ) {
364
364
message -> id = hw_message -> rxf0 .bit .ID ;
365
365
} 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
367
367
}
368
368
message -> rtr = hw_message -> rxf0 .bit .RTR ;
369
369
message -> size = hw_message -> rxf1 .bit .DLC ;
0 commit comments