From 63d8d89780dba041083808b42fec034772ed0c83 Mon Sep 17 00:00:00 2001 From: zwsd Date: Tue, 12 Jul 2022 16:07:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9cmakelists?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/CMakeLists.txt | 2 +- main/gatts_demo.c | 6 +++--- main/motor_drive.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 379d465..790652c 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -1,2 +1,2 @@ -idf_component_register(SRCS "gatts_demo.c" +idf_component_register(SRCS "gatts_demo.c" "motor_drive.c" INCLUDE_DIRS ".") diff --git a/main/gatts_demo.c b/main/gatts_demo.c index acf9650..2952de6 100644 --- a/main/gatts_demo.c +++ b/main/gatts_demo.c @@ -821,8 +821,8 @@ void app_main(void) { esp_err_t ret; - // motor_init(); - // motor_encoder_init(); + motor_init(); + motor_encoder_init(); // timer_group_init(TIMER_GROUP_0, TIMER_0, false, timer_interval_num, timer_interval_ms); timer_group_init(TIMER_GROUP_0, TIMER_0, false, timer_group0_interval_num, timer_interval_ms); @@ -972,7 +972,7 @@ void bluetooth_gatts_try_process_data() if (strcmp(s_bluetooth_processer.order, set_position) == 0) { ESP_LOGI(GATTS_TAG, set_position); - // motor_cmd_set_position(s_bluetooth_processer.speed_level, s_bluetooth_processer.position, s_bluetooth_processer.direction); + motor_cmd_set_position(s_bluetooth_processer.speed_level, s_bluetooth_processer.position, s_bluetooth_processer.direction); receipt_json_set_position(); } if (strcmp(s_bluetooth_processer.order, get_status) == 0) diff --git a/main/motor_drive.c b/main/motor_drive.c index 65b9ee6..5303a80 100644 --- a/main/motor_drive.c +++ b/main/motor_drive.c @@ -46,7 +46,7 @@ int motor_find_short_path_direction(double position) { return 1; } - return; + return -1; } double motor_read_encoder()