Skip to content

Commit be22522

Browse files
committed
bros ok match bros
1 parent 55da0b6 commit be22522

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

board/drivers/can.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,13 @@ void bitbang_gmlan(CAN_FIFOMailBox_TypeDef *to_bang) {
488488
0,0,1, // 1st byte 2-0
489489

490490
// start CRC
491-
0,1,0,0,0,0,1,1,0,0,0,0,0,
491+
/*0,1,0,0,0,0,1,1,0,0,0,0,0,
492492
1, // bitstuff
493-
0,0, // CRC field
493+
0,0, // CRC field*/
494+
495+
// CRC from real message
496+
1,1,1,0,1,1,1,0,1,0,1,0,0,1,1,1,
497+
494498
1, // CRC delimiter
495499

496500
1, // ACK

tests/gmbitbang/rigol.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@
1818
rawdata = scope.read_raw()
1919
data = np.frombuffer(rawdata, 'B')
2020
print data.shape
21-
plt.plot(data)
21+
22+
s1 = data[0:600]
23+
s2 = data[600:]
24+
s1i = np.argmax(s1 > 100)
25+
s2i = np.argmax(s2 > 100)
26+
s1 = s1[s1i:]
27+
s2 = s2[s2i:]
28+
29+
plt.plot(s1)
30+
plt.plot(s2)
2231
plt.show()
2332
#data = (data - 130.0 - voltoffset/voltscale*25) / 25 * voltscale
2433

0 commit comments

Comments
 (0)