Setup sjw in can driver
@@ -147,7 +147,19 @@ csp_iface_t * csp_can_socketcan_init(char * ifc, int bitrate, int promisc)
/* Set interface up */
if (bitrate > 0) {
can_do_stop(ifc);
- can_set_bitrate(ifc, bitrate);
+ struct can_bittiming cbt = {
+ //.bitrate = 1000000,
+ //.sample_point = 875,
+ .tq = 125,
+ .prop_seg = 1,
+ .phase_seg1 = 5,
+ .phase_seg2 = 1,
+ .sjw = 4,
+ //.brp = 0
+ };
+ int result = can_set_bittiming(ifc, &cbt);
+ printf("set bittiming %d\n", result);
+ //can_set_bitrate_samplepoint(ifc, bitrate, 875);i
can_set_restart_ms(ifc, 100);
can_do_start(ifc);
}
