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.

64 lines
1.5 KiB

  1. /*
  2. * @Author: sunlight 2524828700@qq.com
  3. * @Date: 2024-09-12 21:05:22
  4. * @LastEditors: sunlight 2524828700@qq.com
  5. * @LastEditTime: 2024-09-23 21:37:16
  6. * @FilePath: \auxiliary_addition\Usr\opration\core.c
  7. * @Description:
  8. */
  9. #include "core.h"
  10. #include "./Processer/tjc_screen_process.h"
  11. #include "./Processer/tjc_screen_receive.h"
  12. #include "module/feite_servo/servo_driver.h"
  13. #include "module/feite_servo/servo_operation.h"
  14. #include "module/feite_servo/servo_reg_map.h"
  15. #include "tim.h"
  16. #include "time_slice/time_slice.h"
  17. #include "usart.h"
  18. #include "zgpio.h"
  19. static uint32_t ticktime_sleep;
  20. static uint8_t data = 1000;
  21. void core_init(void) {
  22. HAL_TIM_Base_Start_IT(&htim2);
  23. //tjc_process_init();
  24. HAL_GPIO_WritePin(GPIOD, GPIO_PIN_13, SET);
  25. servo_uart_init(&huart2);
  26. // servo_drive_single(1, kRegServoAcc, W_DATA, 200, 1);
  27. // servo_drive_single(1, kRegServoRunSpeed, W_DATA, 1000, 1);
  28. }
  29. static int i = 0;
  30. void core_loop(void) {
  31. if (GetFlag(tjc_process)) {
  32. //tjc_processe();
  33. ClearFlag(tjc_process);
  34. }
  35. if (GetFlag(debug_light)) {
  36. debuglightloop();
  37. ClearFlag(debug_light);
  38. }
  39. if (GetFlag(low_power)) {
  40. // Power_SleepMode();
  41. //servo_drive_single(1, kRegServoTargetPos, W_DATA,&i, 1); // ���Գ���
  42. Ping_operete(1);
  43. if (i > 2000)
  44. i -= 50;
  45. else
  46. i += 50;
  47. // Power_StopMode();
  48. // Power_StandByMode();
  49. ClearFlag(low_power);
  50. }
  51. // printf("printf\n");
  52. }
  53. void core_main() {
  54. core_init();
  55. while (1) {
  56. core_loop();
  57. }
  58. }