Files
QD4C-firmware/app/main.c

75 lines
2.6 KiB
C
Raw Normal View History

2023-12-11 21:45:06 +08:00
/*********************************************************************************************************************
* CH32V307VCT6 Opensourec Library CH32V307VCT6 SDK
* Copyright (c) 2022 SEEKFREE
*
* CH32V307VCT6
*
* CH32V307VCT6
* GPLGNU General Public License GNU
* GPL 3 GPL3.0/
*
*
*
* GPL
*
* GPL
* <https://www.gnu.org/licenses/>
*
*
* 使 GPL3.0
* libraries/doc GPL3_permission_statement.txt
* libraries LICENSE
* 使
********************************************************************************************************************/
2024-02-25 11:49:10 +08:00
#include "page.h"
#include "page_ui_widget.h"
#include "jj_param.h"
2024-01-16 20:03:21 +08:00
#include "jj_motion.h"
2024-02-25 11:49:10 +08:00
#include "jj_blueteeth.h"
2024-01-16 20:03:21 +08:00
#include "by_imu.h"
#include "by_vofa.h"
2024-02-25 11:49:10 +08:00
#include "by_buzzer.h"
#include "by_frame.h"
2024-02-25 11:49:10 +08:00
#include "by_rt_button.h"
#include "by_fan_control.h"
int main(void)
2023-12-11 21:45:06 +08:00
{
2024-03-27 10:57:41 +08:00
TYPE_UNION test_data[BY_FRAME_DATA_NUM];
clock_init(SYSTEM_CLOCK_120M);
system_delay_init();
debug_init();
2024-02-07 10:24:11 +08:00
2024-03-03 19:23:21 +08:00
encoder_quad_init(TIM5_ENCOEDER, TIM5_ENCOEDER_MAP0_CH1_A0, TIM5_ENCOEDER_MAP0_CH2_A1);
ips200_init(IPS200_TYPE_SPI);
2024-03-02 16:05:24 +08:00
while (imu660ra_init())
;
jj_param_eeprom_init();
jj_bt_init();
2024-02-07 10:24:11 +08:00
by_rb_init();
by_pwm_init();
2024-03-04 22:33:43 +08:00
by_buzzer_init();
by_frame_init();
2024-02-07 10:24:11 +08:00
Page_Init();
2024-03-02 16:05:24 +08:00
sport_pid_init();
2024-03-05 16:34:56 +08:00
pit_ms_init(TIM1_PIT, 1); // 运动解算,编码器
2024-01-16 20:03:21 +08:00
2024-03-28 04:24:59 +08:00
bt_printf("ok\r\n");
2024-02-07 10:24:11 +08:00
while (1) {
2024-03-27 10:57:41 +08:00
// printf("pwm:%lu,%lu,%lu,%lu\r\n", pwm_duty_ls_g, pwm_duty_rs_g, pwm_duty_lb_g, pwm_duty_rb_g);
2024-02-07 10:24:11 +08:00
Page_Run();
2024-03-27 10:57:41 +08:00
by_frame_parse(&test_data[0].u32);
2024-03-03 19:23:21 +08:00
by_buzzer_run();
2024-03-02 16:05:24 +08:00
jj_bt_run();
2024-03-05 16:34:56 +08:00
in_pos = test_data[1].f32;
in_angle = test_data[0].f32;
2024-03-28 04:24:59 +08:00
in_state= test_data[2].u32;
2023-12-11 21:45:06 +08:00
}
}