From 89cdbfd39c2f975be68481d60fbbbf955f38876a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=BB=D0=B0=20=D0=93=D0=BE=D1=80?= =?UTF-8?q?=D0=BD=D1=83=D1=88=D0=BA=D0=BE?= Date: Fri, 24 Nov 2023 08:43:28 +0300 Subject: [PATCH] adding cmd_can --- main/CMakeLists.txt | 1 + main/cmd_can.c | 7 +++++++ main/cmd_can.h | 9 +++++++++ main/console.c | 2 ++ main/main.c | 1 + 5 files changed, 20 insertions(+) create mode 100644 main/cmd_can.c create mode 100644 main/cmd_can.h diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 3516e52..af54de9 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -5,6 +5,7 @@ set(COMPONENT_SRCS "console.c" "fs.c" "xvprintf.c" + "cmd_can.c" ) set(COMPONENT_ADD_INCLUDEDIRS diff --git a/main/cmd_can.c b/main/cmd_can.c new file mode 100644 index 0000000..50370b2 --- /dev/null +++ b/main/cmd_can.c @@ -0,0 +1,7 @@ +#include "cmd_can.h" +#include "driver/twai.h" +#include "hal/twai_types.h" + +void register_can_commands(void) { + +} diff --git a/main/cmd_can.h b/main/cmd_can.h new file mode 100644 index 0000000..37be647 --- /dev/null +++ b/main/cmd_can.h @@ -0,0 +1,9 @@ +#ifndef MAIN_CMD_CAN_H +#define MAIN_CMD_CAN_H + + +// functions + +void register_can_commands(void); + +#endif // MAIN_CMD_CAN_H diff --git a/main/console.c b/main/console.c index dd56f98..ed8ce48 100644 --- a/main/console.c +++ b/main/console.c @@ -15,6 +15,7 @@ #include "esp_vfs_usb_serial_jtag.h" #include "driver/usb_serial_jtag.h" #include "cmd_system.h" +#include "cmd_can.h" #include "fs.h" #include "xvprintf.h" @@ -154,4 +155,5 @@ void initialize_console(void) { /* Register commands */ esp_console_register_help_command(); register_system(); + register_can_commands(); } diff --git a/main/main.c b/main/main.c index f7a9841..99f10f9 100644 --- a/main/main.c +++ b/main/main.c @@ -6,6 +6,7 @@ #include "console.h" #include "xvprintf.h" + void app_main(void) { can_init(); init_tx_ringbuf();