You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
1.0 KiB

  1. int total;
  2. void on_click(){
  3. send_cmd();
  4. }
  5. void on_rep(){
  6. total++;
  7. if (total != 8){
  8. take_photo();
  9. send_cmd();
  10. }
  11. }
  12. int main(){
  13. }
  14. ---------------------------------------
  15. void on_message(message){
  16. if(message = setPotion){
  17. motor_set_postion(speed, poitions direction);
  18. send_receipt();
  19. }else if(message == getDeviceState){
  20. send_receipt();
  21. }
  22. }
  23. void on_motor_stop(){
  24. send_report();
  25. }
  26. void on_motor_exception(){
  27. }
  28. void main(){
  29. ble_init(onmessage);
  30. motor_init(on_motor_stop);
  31. }
  32. ---------------------------------------
  33. onmessage_t onmessage;
  34. void ble_init(onmessage);
  35. void ble_send();
  36. ---------------------------------------
  37. void motor_init(on_motor_stop,on_motor_exception);
  38. void motor_set_postion(speed, poitions direction);
  39. void motor_get_positon();
  40. void motor_is_running();
  41. void motor_get_exception();
  42. void motor_processs(){
  43. ticket = getnow
  44. }
  45. -----------------------------------------
  46. 中断上下文
  47. main上下文