Changed the default pin of ESP32-S2
This commit is contained in:
@@ -19,10 +19,10 @@ Use twai(Two-Wire Automotive Interface) driver instead of can driver.
|
|||||||
|
|
||||||
|SN65HVD23x||ESP32|ESP32-S2||
|
|SN65HVD23x||ESP32|ESP32-S2||
|
||||||
|:-:|:-:|:-:|:-:|:-:|
|
|:-:|:-:|:-:|:-:|:-:|
|
||||||
|D(CTX)|--|GPIO21|GPIO20|(*1)|
|
|D(CTX)|--|GPIO21|GPIO17|(*1)|
|
||||||
|GND|--|GND|GND||
|
|GND|--|GND|GND||
|
||||||
|Vcc|--|3.3V|3.3V||
|
|Vcc|--|3.3V|3.3V||
|
||||||
|R(CRX)|--|GPIO22|GPIO21|(*1)|
|
|R(CRX)|--|GPIO22|GPIO18|(*1)|
|
||||||
|Vref|--|N/C|N/C||
|
|Vref|--|N/C|N/C||
|
||||||
|CANL|--|||To CAN Bus|
|
|CANL|--|||To CAN Bus|
|
||||||
|CANH|--|||To CAN Bus|
|
|CANH|--|||To CAN Bus|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ menu "Application Configuration"
|
|||||||
int "CTX GPIO number"
|
int "CTX GPIO number"
|
||||||
range 0 34
|
range 0 34
|
||||||
default 2 if IDF_TARGET_ESP32C3
|
default 2 if IDF_TARGET_ESP32C3
|
||||||
default 20 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
default 17 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
||||||
default 21 if IDF_TARGET_ESP32
|
default 21 if IDF_TARGET_ESP32
|
||||||
help
|
help
|
||||||
GPIO number (IOxx) to CTX.
|
GPIO number (IOxx) to CTX.
|
||||||
@@ -56,7 +56,7 @@ menu "Application Configuration"
|
|||||||
int "CRX GPIO number"
|
int "CRX GPIO number"
|
||||||
range 0 34
|
range 0 34
|
||||||
default 3 if IDF_TARGET_ESP32C3
|
default 3 if IDF_TARGET_ESP32C3
|
||||||
default 21 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
default 18 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
|
||||||
default 22 if IDF_TARGET_ESP32
|
default 22 if IDF_TARGET_ESP32
|
||||||
help
|
help
|
||||||
GPIO number (IOxx) to CRX.
|
GPIO number (IOxx) to CRX.
|
||||||
|
|||||||
+2
-1
@@ -38,7 +38,8 @@ void twai_task(void *pvParameters)
|
|||||||
twai_message_t rx_msg;
|
twai_message_t rx_msg;
|
||||||
FRAME_t frameBuf;
|
FRAME_t frameBuf;
|
||||||
while (1) {
|
while (1) {
|
||||||
esp_err_t ret = twai_receive(&rx_msg, pdMS_TO_TICKS(1));
|
//esp_err_t ret = twai_receive(&rx_msg, pdMS_TO_TICKS(1));
|
||||||
|
esp_err_t ret = twai_receive(&rx_msg, pdMS_TO_TICKS(10));
|
||||||
if (ret == ESP_OK) {
|
if (ret == ESP_OK) {
|
||||||
ESP_LOGD(TAG,"twai_receive identifier=0x%x flags=0x%x data_length_code=%d",
|
ESP_LOGD(TAG,"twai_receive identifier=0x%x flags=0x%x data_length_code=%d",
|
||||||
rx_msg.identifier, rx_msg.flags, rx_msg.data_length_code);
|
rx_msg.identifier, rx_msg.flags, rx_msg.data_length_code);
|
||||||
|
|||||||
Reference in New Issue
Block a user