Gedare Bloom started a new discussion on cpukit/dev/can/sja1000/sja1000.c: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1183#note_148018

 > +{
 > +  struct sja1000_internal *internal = chip->internal;
 > +  struct can_frame err_frame = {};
 > +  enum can_state state;
 > +  uint8_t rxerr;
 > +  uint8_t txerr;
 > +  uint8_t ecc;
 > +
 > +  rxerr = sja1000_read_reg( internal, SJA1000_RXERR );
 > +  txerr = sja1000_read_reg( internal, SJA1000_TXERR1 );
 > +
 > +  state = sja1000_read_fault_state( internal );
 > +  rtems_can_stats_set_state(&chip->chip_stats, state);
 > +  atomic_fetch_and( &internal->isr, ~( REG_INT_EPI ) );
 > +
 > +  if ( FIELD_GET( REG_INT_EI, isr ) ) {

I might make these a switch with function calls for specific error handling.

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1183#note_148018
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to