Changed the default pin of ESP32-S2

This commit is contained in:
nopnop2002
2021-07-08 07:49:00 +09:00
parent 00287611fd
commit 52a1ab54a2
3 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -19,10 +19,10 @@ Use twai(Two-Wire Automotive Interface) driver instead of can driver.
|SN65HVD23x||ESP32|ESP32-S2||
|:-:|:-:|:-:|:-:|:-:|
|D(CTX)|--|GPIO21|GPIO20|(*1)|
|D(CTX)|--|GPIO21|GPIO17|(*1)|
|GND|--|GND|GND||
|Vcc|--|3.3V|3.3V||
|R(CRX)|--|GPIO22|GPIO21|(*1)|
|R(CRX)|--|GPIO22|GPIO18|(*1)|
|Vref|--|N/C|N/C||
|CANL|--|||To CAN Bus|
|CANH|--|||To CAN Bus|
+2 -2
View File
@@ -45,7 +45,7 @@ menu "Application Configuration"
int "CTX GPIO number"
range 0 34
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
help
GPIO number (IOxx) to CTX.
@@ -56,7 +56,7 @@ menu "Application Configuration"
int "CRX GPIO number"
range 0 34
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
help
GPIO number (IOxx) to CRX.
+2 -1
View File
@@ -38,7 +38,8 @@ void twai_task(void *pvParameters)
twai_message_t rx_msg;
FRAME_t frameBuf;
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) {
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);