Skip to content

Commit e6c525a

Browse files
authored
Smiplify Leonardo example
1 parent e2de7a8 commit e6c525a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

examples/leonardo_cdc/leonardo_cdc/leonardo_cdc.ino

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@ CanHacker *canHacker = NULL;
1717
void setup() {
1818
Serial.begin(115200);
1919
SPI.begin();
20-
21-
Stream *interfaceStream = &Serial;
22-
Stream *debugStream = &Serial;
23-
2420

25-
canHacker = new CanHacker(interfaceStream, debugStream, SPI_CS_PIN);
21+
canHacker = new CanHacker(&Serial, NULL, SPI_CS_PIN);
2622
canHacker->enableLoopback(); // Enable Loopback mode for offline tests
2723
lineReader = new CanHackerLineReader(canHacker);
2824

@@ -31,10 +27,10 @@ void setup() {
3127

3228
void loop() {
3329
if (digitalRead(INT_PIN) == LOW) {
34-
CanHacker::ERROR error = canHacker->processInterrupt();
30+
canHacker->processInterrupt();
3531
}
3632
if (Serial.available()) {
37-
CanHacker::ERROR error = lineReader->process();
33+
lineReader->process();
3834
}
3935
}
4036

0 commit comments

Comments
 (0)