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
64 lines
1.5 KiB
/*
|
|
* @Author: sunlight 2524828700@qq.com
|
|
* @Date: 2024-09-12 21:05:22
|
|
* @LastEditors: sunlight 2524828700@qq.com
|
|
* @LastEditTime: 2024-09-23 21:37:16
|
|
* @FilePath: \auxiliary_addition\Usr\opration\core.c
|
|
* @Description: ´úÂëºËÐÄÔËÐÐ
|
|
*/
|
|
#include "core.h"
|
|
|
|
#include "./Processer/tjc_screen_process.h"
|
|
#include "./Processer/tjc_screen_receive.h"
|
|
#include "module/feite_servo/servo_driver.h"
|
|
#include "module/feite_servo/servo_operation.h"
|
|
#include "module/feite_servo/servo_reg_map.h"
|
|
#include "tim.h"
|
|
#include "time_slice/time_slice.h"
|
|
#include "usart.h"
|
|
#include "zgpio.h"
|
|
static uint32_t ticktime_sleep;
|
|
static uint8_t data = 1000;
|
|
void core_init(void) {
|
|
HAL_TIM_Base_Start_IT(&htim2);
|
|
//tjc_process_init();
|
|
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_13, SET);
|
|
servo_uart_init(&huart2);
|
|
|
|
// servo_drive_single(1, kRegServoAcc, W_DATA, 200, 1);
|
|
// servo_drive_single(1, kRegServoRunSpeed, W_DATA, 1000, 1);
|
|
}
|
|
static int i = 0;
|
|
void core_loop(void) {
|
|
if (GetFlag(tjc_process)) {
|
|
//tjc_processe();
|
|
ClearFlag(tjc_process);
|
|
}
|
|
if (GetFlag(debug_light)) {
|
|
debuglightloop();
|
|
ClearFlag(debug_light);
|
|
}
|
|
|
|
if (GetFlag(low_power)) {
|
|
// Power_SleepMode();
|
|
//servo_drive_single(1, kRegServoTargetPos, W_DATA,&i, 1); // ²âÊÔ³ÌÐò
|
|
Ping_operete(1);
|
|
if (i > 2000)
|
|
i -= 50;
|
|
else
|
|
i += 50;
|
|
|
|
// Power_StopMode();
|
|
// Power_StandByMode();
|
|
ClearFlag(low_power);
|
|
}
|
|
|
|
// printf("printf\n");
|
|
}
|
|
|
|
void core_main() {
|
|
core_init();
|
|
while (1) {
|
|
core_loop();
|
|
}
|
|
}
|