Browse Source

两个预留按键测试以及初始化(预留),以及工程涉及的文档上传

master
zwsd 3 years ago
parent
commit
117f0c6ff6
  1. 3
      .vscode/settings.json
  2. 73191
      doc/RMD电机RS485协议说明 (2).pdf
  3. BIN
      doc/医美引脚分配表.xlsx
  4. BIN
      doc/智慧医美拍照椅协议v1.0.pdf
  5. 26
      main/main.c

3
.vscode/settings.json

@ -39,6 +39,7 @@
"bitset": "c",
"chrono": "c",
"algorithm": "c",
"port.h": "c"
"port.h": "c",
"gpio.h": "c"
},
}

73191
doc/RMD电机RS485协议说明 (2).pdf
File diff suppressed because it is too large
View File

BIN
doc/医美引脚分配表.xlsx

BIN
doc/智慧医美拍照椅协议v1.0.pdf

26
main/main.c

@ -17,6 +17,9 @@
#define MAIN_LOG_TAG "MAIN"
#define ble_uart_tx_size 128
#define ble_uart_rx_size 128
#define KEY_INT1 27
#define KEY_INT2 14
#define GPIO_KEY_INPUT_PIN_SEL ((1ULL << KEY_INT1) | (1ULL << KEY_INT2))
static uint8_t bluetooth_tx_buffer[ble_uart_tx_size] = {0};
static uint8_t bluetooth_rx_buffer[ble_uart_rx_size] = {0};
@ -63,9 +66,8 @@ void processrxjson(cJSON *rxjson) {
if (strcmp(order, "setPosition") == 0) {
process_setPosition(rxjson);
} else if (strcmp(order, "getStatus") == 0) {
} else if (strcmp(order, "getStatus") == 0) {
}
}
@ -90,10 +92,22 @@ void motor_on_event(motor_event_t event) {
//
//{ "order": "deviceStatusReport", "ble_uart_index": 0, "deviceState": "running", "position":13.9, "deviceException": 0, "deviceExceptionInfo": "", }
sprintf((char *)buffer, "{ \"order\": \"receipt\", \"code\": 0, \"info\": \"success\", \"index\": %d }", 1);
bleuart_notify_send(buffer,strlen((char *)buffer));
bleuart_notify_send(buffer, strlen((char *)buffer));
}
}
void gpio_debug_light_init() {
gpio_config_t gpio_grb_led_structer;
gpio_grb_led_structer.intr_type = GPIO_INTR_DISABLE;
gpio_grb_led_structer.mode = GPIO_MODE_INPUT;
gpio_grb_led_structer.pin_bit_mask = GPIO_KEY_INPUT_PIN_SEL;
gpio_grb_led_structer.pull_down_en = 0;
gpio_grb_led_structer.pull_up_en = 0;
gpio_config(&gpio_grb_led_structer);
}
void app_main(void) {
bleuart_init(&ble_uart_init_struct);
bleuart_reg_cb(blerxcb);
@ -102,7 +116,9 @@ void app_main(void) {
motor_reg_event_cb(motor_on_event);
while (true) {
bleuart_schedule();
motor_module_schedule();
// bleuart_schedule();
// motor_module_schedule();
// ESP_LOGI("log1", "%d", gpio_get_level(27));
ESP_LOGI("log2", "%d", gpio_get_level(14));
}
}
Loading…
Cancel
Save