diff --git a/.vscode/settings.json b/.vscode/settings.json index 5b18e0d..fabb43d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -21,6 +21,10 @@ "esp_gatts_api.h": "c", "freertos.h": "c", "regex": "c", - "ble_parse_data.h": "c" + "ble_parse_data.h": "c", + "timer_u.h": "c", + "task.h": "c", + "string.h": "c", + "motor_drive.h": "c" }, } \ No newline at end of file diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 128a99e..2753f64 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -4,6 +4,7 @@ idf_component_register(SRCS # "main.c" "timer_u.c" "ble_parse_data.c" + "motor_drive.c" INCLUDE_DIRS # "../dep/" ".") diff --git a/main/ble_parse_data.c b/main/ble_parse_data.c index d1367c1..9de90aa 100644 --- a/main/ble_parse_data.c +++ b/main/ble_parse_data.c @@ -1,4 +1,5 @@ #include "ble_parse_data.h" +#include "motor_drive.h" #define BLE_PARSE_DATA_TAG "BLE_PARSE_DATA" @@ -32,17 +33,16 @@ void bluetooth_gatts_try_process_data() { if (strcmp(parse_bluetooth_processer->order, set_position) == 0) { ESP_LOGI(BLE_PARSE_DATA_TAG, set_position); // motor_cmd_set_position(parse_bluetooth_processer->speedLevel, parse_bluetooth_processer->position, parse_bluetooth_processer->direction); - // receipt_json_set_position(); + receipt_json_set_position(); } if (strcmp(parse_bluetooth_processer->order, get_status) == 0) { ESP_LOGI(BLE_PARSE_DATA_TAG, get_status); - // receipt_json_get_status(); + receipt_json_get_status(); } // if (strcmp(parse_bluetooth_processer->order, "deviceStatusReport") == 0) // { // ESP_LOGI(BLE_PARSE_DATA_TAG, "deviceStatusReport"); // } - parse_bluetooth_processer->auto_report_flag = true; } } diff --git a/main/ble_parse_data.h b/main/ble_parse_data.h index 7d56a2b..d1a1dec 100644 --- a/main/ble_parse_data.h +++ b/main/ble_parse_data.h @@ -1,3 +1,4 @@ +#pragma once #include #include #include diff --git a/main/ble_spp_server_demo.h b/main/ble_spp_server_demo.h index 7eeea64..58d4690 100644 --- a/main/ble_spp_server_demo.h +++ b/main/ble_spp_server_demo.h @@ -5,7 +5,7 @@ software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ - +#pragma once #include #include #include diff --git a/main/main.c b/main/main.c index 7f26bcc..d154237 100644 --- a/main/main.c +++ b/main/main.c @@ -9,6 +9,7 @@ // #include "ble_spp_server_demo.h" #include "timer_u.h" +#include "motor_drive.h" #define MAIN_TAG "MAIN" diff --git a/main/motor_drive.c b/main/motor_drive.c new file mode 100644 index 0000000..c397465 --- /dev/null +++ b/main/motor_drive.c @@ -0,0 +1,6 @@ +#include "motor_drive.h" + +void motor_drive_uart_init() {} + +void motor_drive_turn(int direction, int speed_level, double position) {} + diff --git a/main/motor_drive.h b/main/motor_drive.h new file mode 100644 index 0000000..a89130b --- /dev/null +++ b/main/motor_drive.h @@ -0,0 +1,8 @@ +#pragma once + +#include +#include +#include + +void motor_drive_uart_init(); +void motor_drive_turn(int direction, int speed_level, double position); \ No newline at end of file diff --git a/main/timer_u.h b/main/timer_u.h index 4ced143..861a86f 100644 --- a/main/timer_u.h +++ b/main/timer_u.h @@ -1,3 +1,4 @@ +#pragma once #include #include "driver/timer.h"