File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,12 @@ Stream *CanHacker::getInterfaceStream() {
54
54
return _stream;
55
55
}
56
56
57
+ void CanHacker::setClock (uint8_t clock){
58
+ canClock = clock;
59
+ }
60
+
57
61
CanHacker::ERROR CanHacker::connectCan () {
58
- MCP2515::ERROR error = mcp2515->setBitrate (bitrate);
62
+ MCP2515::ERROR error = mcp2515->setBitrate (bitrate, canClock );
59
63
if (error != MCP2515::ERROR_OK) {
60
64
writeDebugStream (F (" setBitrate error:\n " ));
61
65
writeDebugStream ((int )error);
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ class CanHacker {
47
47
48
48
CanHacker (Stream *stream, Stream *debugStream, uint8_t cs);
49
49
~CanHacker ();
50
+ void setClock (const uint8_t clock);
50
51
ERROR receiveCommand (const char *buffer, const int length);
51
52
ERROR receiveCanFrame (const struct can_frame *frame);
52
53
ERROR sendFrame (const struct can_frame *);
@@ -64,6 +65,7 @@ class CanHacker {
64
65
static const char BEL = 7 ;
65
66
static const uint16_t TIMESTAMP_LIMIT = 0xEA60 ;
66
67
68
+ uint8_t canClock = MCP_16MHZ;
67
69
bool _timestampEnabled = false ;
68
70
bool _listenOnly = false ;
69
71
bool _loopback = false ;
You can’t perform that action at this time.
0 commit comments