|
|
@ -8,8 +8,8 @@ |
|
|
|
#include "string.h" |
|
|
|
// |
|
|
|
#include "ble_spp_server_demo.h" |
|
|
|
#include "timer_u.h" |
|
|
|
#include "motor_drive.h" |
|
|
|
#include "timer_u.h" |
|
|
|
|
|
|
|
#define MAIN_TAG "MAIN" |
|
|
|
|
|
|
@ -44,12 +44,14 @@ bluetooth_processer_t s_bluetooth_processer = { |
|
|
|
|
|
|
|
.cmd_flag = false, |
|
|
|
.auto_report_flag = false, |
|
|
|
.motor_drive_turn_flag = false, |
|
|
|
}; |
|
|
|
|
|
|
|
void app_main(void) { |
|
|
|
constructor_bluetooth_processer(&s_bluetooth_processer); |
|
|
|
ble_spp_server_demo_app_main(&s_bluetooth_processer); |
|
|
|
timer_group_init(TIMER_GROUP_0, TIMER_0, false, timer_group0_interval_num, timer_interval_ms); |
|
|
|
motor_drive_uart_init(); |
|
|
|
|
|
|
|
while (true) { |
|
|
|
bluetooth_gatts_try_process_data(); |
|
|
@ -57,6 +59,11 @@ void app_main(void) { |
|
|
|
receipt_json_get_status(); |
|
|
|
s_bluetooth_processer.auto_report_flag = false; |
|
|
|
} |
|
|
|
|
|
|
|
if ((motor_drive_read_encoder() == s_bluetooth_processer.position) && s_bluetooth_processer.motor_drive_turn_flag == true) { |
|
|
|
ESP_LOGI("test", "info log ok\n"); |
|
|
|
s_bluetooth_processer.motor_drive_turn_flag = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return; |
|
|
|