fix: Init TWAI before UART0 to prevent GPIO 43/44 pin conflict

UART0 init was claiming GPIO 43/44 before TWAI could use them for CAN.
Swapping init order ensures TWAI gets GPIO 43/44 (where the SN65HVD230
transceiver is physically wired per Waveshare board design).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sebastien Vayrette 2026-04-20 11:48:43 -04:00
parent 06219afe69
commit 9b4a31aa66

View File

@ -114,9 +114,9 @@ void app_main(void)
{ {
ESP_LOGI(TAG, "ESP32-S3 BALANCE bd-66hx starting"); ESP_LOGI(TAG, "ESP32-S3 BALANCE bd-66hx starting");
/* Init peripherals */ /* Init CAN FIRST — TWAI must claim GPIO 43/44 before UART0 can grab them */
orin_serial_init();
vesc_can_init(); vesc_can_init();
orin_serial_init();
/* TX queue for outbound serial frames */ /* TX queue for outbound serial frames */
s_orin_tx_q = xQueueCreate(ORIN_TX_QUEUE_DEPTH, sizeof(orin_tx_frame_t)); s_orin_tx_q = xQueueCreate(ORIN_TX_QUEUE_DEPTH, sizeof(orin_tx_frame_t));