Browse Source

update

devtest
zwsd 3 years ago
parent
commit
369548c2d0
  1. 6
      .vscode/settings.json
  2. 1
      main/CMakeLists.txt
  3. 6
      main/ble_parse_data.c
  4. 1
      main/ble_parse_data.h
  5. 2
      main/ble_spp_server_demo.h
  6. 1
      main/main.c
  7. 6
      main/motor_drive.c
  8. 8
      main/motor_drive.h
  9. 1
      main/timer_u.h

6
.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"
},
}

1
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/"
".")

6
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;
}
}

1
main/ble_parse_data.h

@ -1,3 +1,4 @@
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

2
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 <stdio.h>
#include <stdlib.h>
#include <string.h>

1
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"

6
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) {}

8
main/motor_drive.h

@ -0,0 +1,8 @@
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void motor_drive_uart_init();
void motor_drive_turn(int direction, int speed_level, double position);

1
main/timer_u.h

@ -1,3 +1,4 @@
#pragma once
#include <stdint.h>
#include "driver/timer.h"

Loading…
Cancel
Save