Skip to content

Commit bcdd7ac

Browse files
Mr 0wlsandeepmistry
Mr 0wl
authored andcommitted
Baudrates lower than 50kbps removed due to hw/RTOS limits
1 parent 974d218 commit bcdd7ac

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

src/ESP32SJA1000.cpp

+4-16
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,10 @@ int ESP32SJA1000Class::begin(long baudRate)
111111
modifyRegister(REG_BTR0, 0x3f, 49);
112112
break;
113113

114-
case (long)40E3:
115-
modifyRegister(REG_BTR1, 0x0f, 0x0c);
116-
modifyRegister(REG_BTR0, 0x3f, 62);
117-
break;
118-
119-
case (long)20E3:
120-
modifyRegister(REG_BTR1, 0x0f, 0x0c);
121-
modifyRegister(REG_BTR0, 0x3f, 124);
122-
break;
123-
124-
case (long)10E3:
125-
modifyRegister(REG_BTR1, 0x0f, 0x0c);
126-
modifyRegister(REG_BTR0, 0x3f, 249);
127-
break;
128-
114+
/*
115+
Due to limitations in ESP32 hardware and/or RTOS software, baudrate can't be lower than 50kbps.
116+
See https://esp32.com/viewtopic.php?t=2142
117+
*/
129118
default:
130119
return 0;
131120
break;
@@ -144,7 +133,6 @@ int ESP32SJA1000Class::begin(long baudRate)
144133
writeRegister(REG_AMRn(2), 0xff);
145134
writeRegister(REG_AMRn(3), 0xff);
146135

147-
148136
modifyRegister(REG_OCR, 0x03, 0x02); // normal output mode
149137
// reset error counters
150138
writeRegister(REG_TXERR, 0x00);

0 commit comments

Comments
 (0)