From 52a1ab54a211d8fef40dbfbcd980fc2e10be5e64 Mon Sep 17 00:00:00 2001 From: nopnop2002 Date: Thu, 8 Jul 2021 07:49:00 +0900 Subject: [PATCH] Changed the default pin of ESP32-S2 --- README.md | 4 ++-- main/Kconfig.projbuild | 4 ++-- main/twai.c | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 22ed5b6..e9add25 100644 --- a/README.md +++ b/README.md @@ -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| diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild index 53c42d1..0bb7aa0 100644 --- a/main/Kconfig.projbuild +++ b/main/Kconfig.projbuild @@ -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. diff --git a/main/twai.c b/main/twai.c index b237cb3..e68fced 100644 --- a/main/twai.c +++ b/main/twai.c @@ -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);