From 7ad7f55eb8b6bc29947471cdc0b8c17fa709170d Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Sun, 27 Aug 2023 10:49:33 -0700 Subject: [PATCH] wire up CAN init --- firmware/bootloader/openblt_chibios/openblt_can.cpp | 7 ++++++- firmware/bootloader/src/Makefile | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/firmware/bootloader/openblt_chibios/openblt_can.cpp b/firmware/bootloader/openblt_chibios/openblt_can.cpp index b4d0d57e33..0c59382e27 100644 --- a/firmware/bootloader/openblt_chibios/openblt_can.cpp +++ b/firmware/bootloader/openblt_chibios/openblt_can.cpp @@ -2,6 +2,8 @@ #include "hal.h" +#include "can_hw.h" + extern "C" { #include "boot.h" } @@ -13,7 +15,10 @@ extern "C" { ****************************************************************************************/ extern "C" void CanInit(void) { - // TODO + // TODO: init pins? + + auto cfg = findCanConfig(B500KBPS); + canStart(&CAND1, cfg); } diff --git a/firmware/bootloader/src/Makefile b/firmware/bootloader/src/Makefile index 37832a4d58..782b798f00 100644 --- a/firmware/bootloader/src/Makefile +++ b/firmware/bootloader/src/Makefile @@ -183,6 +183,7 @@ CPPSRC = $(ALLCPPSRC) \ $(HW_LAYER_EMS_CPP) \ $(BOARDCPPSRC) \ $(PROJECT_DIR)/util/efilib.cpp \ + $(PROJECT_DIR)/hw_layer/drivers/can/can_config.cpp \ $(PROJECT_DIR)/hw_layer/pin_repository.cpp \ $(RUSEFI_LIB_CPP) \ $(PROJECT_DIR)/bootloader/openblt_chibios/openblt_can.cpp \