candle-usb / candleLight_fw

gs_usb compatible firmware for candleLight, cantact and canable
Other
642 stars 283 forks source link

Feature: add support for `GS_CAN_FEATURE_GET_STATE` and `GS_CAN_FEATURE_BERR_REPORTING` #154

Open marckleinebudde opened 1 year ago

marckleinebudde commented 1 year ago

In this issue I want to track implementation of the GS_CAN_FEATURE_GET_STATE and GS_CAN_FEATURE_BERR_REPORTING features.

@jhofstee, do you have some work-in-progress code somewhere? Is the newest code in this branch? https://github.com/jhofstee/candleLight_fw/tree/canbus-state

marckleinebudde commented 1 year ago

As far as I can see in https://github.com/candle-usb/candleLight_fw/pull/107 and https://github.com/candle-usb/candleLight_fw/pull/119 the error frame generation was cleaned up. I want to make sure that this is merged and no code was forgotten.

marckleinebudde commented 1 year ago

In https://github.com/candle-usb/candleLight_fw/pull/124#issuecomment-1303920718 @jhofstee says his implementation can be rebased to mainline.

marckleinebudde commented 1 year ago

FTR: The new features have been documented in https://github.com/candle-usb/candleLight_fw/pull/124.

Linux support has been mainlined with https://github.com/torvalds/linux/commit/0c9f92a4b795a68c005ebe215f31b2ad7838b9ea

fenugrec commented 1 year ago

I wonder if this could be extended to count dropped frames (RX overflows) ...

marckleinebudde commented 1 year ago

We already have the GS_CAN_FLAG_OVERFLOW to signal a RX overflow to Linux: https://github.com/candle-usb/candleLight_fw/blob/4a1e646cdb0b5b45bbc6c5bf77013205386f2da6/include/gs_usb.h#L83 It's not used in the candlelight FW, though.