This commit is contained in:
2023-12-16 11:39:22 +08:00
6 changed files with 224 additions and 211 deletions

26
app/by_fan_control.c Normal file
View File

@@ -0,0 +1,26 @@
#include "by_fan_control.h"
#include "zf_common_headfile.h"
void by_pwm_init(void)
{
pwm_init(TIM4_PWM_MAP1_CH1_D12, 10000, 0); // 浮力风扇左
pwm_init(TIM4_PWM_MAP1_CH2_D13, 10000, 0); // 浮力风扇右
pwm_init(TIM4_PWM_MAP1_CH3_D14, 10000, 0); // 动力风扇左
pwm_init(TIM4_PWM_MAP1_CH4_D15, 10000, 0); // 动力风扇右
}
void by_pwm_update_duty(uint32_t update_pwm_duty)
{
if (7000UL > update_pwm_duty) {
update_pwm_duty = 7000UL;
}
pwm_set_duty(TIM4_PWM_MAP1_CH1_D12, update_pwm_duty);
pwm_set_duty(TIM4_PWM_MAP1_CH2_D13, update_pwm_duty);
}
void by_pwm_power_duty(uint32_t power_pwm_duty_l, uint32_t power_pwm_duty_r)
{
pwm_set_duty(TIM4_PWM_MAP1_CH3_D14, power_pwm_duty_l);
pwm_set_duty(TIM4_PWM_MAP1_CH4_D15, power_pwm_duty_r);
}

11
app/by_fan_control.h Normal file
View File

@@ -0,0 +1,11 @@
#ifndef _BY_FAN_CONTROL_H_
#define _BY_FAN_CONTROL_H_
#include "stdio.h"
#include "ch32v30x.h"
extern void by_pwm_init(void);
extern void by_pwm_update_duty(uint32_t update_pwm_duty);
extern void by_pwm_power_duty(uint32_t power_pwm_duty_l, uint32_t power_pwm_duty_r);
#endif

27
app/by_pt_button.c Normal file
View File

@@ -0,0 +1,27 @@
#include "by_pt_button.h"
#include "zf_common_headfile.h"
uint8_t potate_button;
void by_gpio_init(void)
{
gpio_init(E10, GPI, GPIO_HIGH, GPI_PULL_UP);
}
void by_exit_init(void)
{
exti_init(E9, EXTI_TRIGGER_FALLING);
exti_init(E11, EXTI_TRIGGER_FALLING);
}
uint8_t by_get_pb_statu(void)
{
uint8_t temp_s = potate_button;
potate_button = 0;
return temp_s;
}
void by_ips_show(void)
{
ips114_show_string(0, 0, "button statu:");
ips114_show_uint(104, 0, by_get_pb_statu(), 1);
}

15
app/by_pt_button.h Normal file
View File

@@ -0,0 +1,15 @@
#ifndef _BY_PT_BUTTON_H__
#define _BY_PT_BUTTON_H__
#include "stdio.h"
#include "ch32v30x.h"
#define POTATE_BUTTOM_PRESS 1
#define POTATE_BUTTOM_FOREWARD 2
#define POTATE_BUTTOM_BACKWARD 3
extern uint8_t potate_button;
extern void by_exit_init(void);
extern void by_gpio_init(void);
extern uint8_t by_get_pb_statu(void);
extern void by_ips_show(void);
#endif

334
app/isr.c
View File

@@ -1,73 +1,75 @@
/*********************************************************************************************************************
* 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 文件
* 欢迎各位使用并传播本程序 但修改内容时必须保留逐飞科技的版权声明(即本声明)
*
* 文件名称 isr
* 公司名称 成都逐飞科技有限公司
* 版本信息 查看 libraries/doc 文件夹内 version 文件 版本说明
* 开发环境 MounRiver Studio V1.8.1
* 适用平台 CH32V307VCT6
* 店铺链接 https://seekfree.taobao.com/
*
* 修改记录
* 日期 作者 备注
* 2022-09-15 大W first version
********************************************************************************************************************/
* 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 文件
* 欢迎各位使用并传播本程序 但修改内容时必须保留逐飞科技的版权声明(即本声明)
*
* 文件名称 isr
* 公司名称 成都逐飞科技有限公司
* 版本信息 查看 libraries/doc 文件夹内 version 文件 版本说明
* 开发环境 MounRiver Studio V1.8.1
* 适用平台 CH32V307VCT6
* 店铺链接 https://seekfree.taobao.com/
*
* 修改记录
* 日期 作者 备注
* 2022-09-15 大W first version
********************************************************************************************************************/
#include "zf_common_headfile.h"
void NMI_Handler(void) __attribute__((interrupt()));
#include "by_pt_button.h"
void NMI_Handler(void) __attribute__((interrupt()));
void HardFault_Handler(void) __attribute__((interrupt()));
void USART1_IRQHandler(void) __attribute__((interrupt()));
void USART2_IRQHandler(void) __attribute__((interrupt()));
void USART3_IRQHandler(void) __attribute__((interrupt()));
void UART4_IRQHandler (void) __attribute__((interrupt()));
void UART5_IRQHandler (void) __attribute__((interrupt()));
void UART6_IRQHandler (void) __attribute__((interrupt()));
void UART7_IRQHandler (void) __attribute__((interrupt()));
void UART8_IRQHandler (void) __attribute__((interrupt()));
void DVP_IRQHandler (void) __attribute__((interrupt()));
//void TIM1_BRK_IRQHandler (void) __attribute__((interrupt()));
void TIM1_UP_IRQHandler (void) __attribute__((interrupt()));
//void TIM1_TRG_COM_IRQHandler (void) __attribute__((interrupt()));
//void TIM1_CC_IRQHandler (void) __attribute__((interrupt()));
void TIM2_IRQHandler (void) __attribute__((interrupt()));
void TIM3_IRQHandler (void) __attribute__((interrupt()));
void TIM4_IRQHandler (void) __attribute__((interrupt()));
void TIM5_IRQHandler (void) __attribute__((interrupt()));
void TIM6_IRQHandler (void) __attribute__((interrupt()));
void TIM7_IRQHandler (void) __attribute__((interrupt()));
//void TIM8_BRK_IRQHandler (void) __attribute__((interrupt()));
void TIM8_UP_IRQHandler (void) __attribute__((interrupt()));
//void TIM8_TRG_COM_IRQHandler (void) __attribute__((interrupt()));
//void TIM8_CC_IRQHandler (void) __attribute__((interrupt()));
//void TIM9_BRK_IRQHandler (void) __attribute__((interrupt()));
void TIM9_UP_IRQHandler (void) __attribute__((interrupt()));
//void TIM9_TRG_COM_IRQHandler (void) __attribute__((interrupt()));
//void TIM9_CC_IRQHandler (void) __attribute__((interrupt()));
//void TIM10_BRK_IRQHandler (void) __attribute__((interrupt()));
void TIM10_UP_IRQHandler (void) __attribute__((interrupt()));
//void TIM10_TRG_COM_IRQHandler (void) __attribute__((interrupt()));
//void TIM10_CC_IRQHandler (void) __attribute__((interrupt()));
void UART4_IRQHandler(void) __attribute__((interrupt()));
void UART5_IRQHandler(void) __attribute__((interrupt()));
void UART6_IRQHandler(void) __attribute__((interrupt()));
void UART7_IRQHandler(void) __attribute__((interrupt()));
void UART8_IRQHandler(void) __attribute__((interrupt()));
void DVP_IRQHandler(void) __attribute__((interrupt()));
// void TIM1_BRK_IRQHandler (void) __attribute__((interrupt()));
void TIM1_UP_IRQHandler(void) __attribute__((interrupt()));
// void TIM1_TRG_COM_IRQHandler (void) __attribute__((interrupt()));
// void TIM1_CC_IRQHandler (void) __attribute__((interrupt()));
void TIM2_IRQHandler(void) __attribute__((interrupt()));
void TIM3_IRQHandler(void) __attribute__((interrupt()));
void TIM4_IRQHandler(void) __attribute__((interrupt()));
void TIM5_IRQHandler(void) __attribute__((interrupt()));
void TIM6_IRQHandler(void) __attribute__((interrupt()));
void TIM7_IRQHandler(void) __attribute__((interrupt()));
// void TIM8_BRK_IRQHandler (void) __attribute__((interrupt()));
void TIM8_UP_IRQHandler(void) __attribute__((interrupt()));
// void TIM8_TRG_COM_IRQHandler (void) __attribute__((interrupt()));
// void TIM8_CC_IRQHandler (void) __attribute__((interrupt()));
// void TIM9_BRK_IRQHandler (void) __attribute__((interrupt()));
void TIM9_UP_IRQHandler(void) __attribute__((interrupt()));
// void TIM9_TRG_COM_IRQHandler (void) __attribute__((interrupt()));
// void TIM9_CC_IRQHandler (void) __attribute__((interrupt()));
// void TIM10_BRK_IRQHandler (void) __attribute__((interrupt()));
void TIM10_UP_IRQHandler(void) __attribute__((interrupt()));
// void TIM10_TRG_COM_IRQHandler (void) __attribute__((interrupt()));
// void TIM10_CC_IRQHandler (void) __attribute__((interrupt()));
void EXTI0_IRQHandler(void) __attribute__((interrupt()));
void EXTI1_IRQHandler(void) __attribute__((interrupt()));
@@ -79,162 +81,134 @@ void EXTI15_10_IRQHandler(void) __attribute__((interrupt()));
void USART1_IRQHandler(void)
{
if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)
{
if (USART_GetITStatus(USART1, USART_IT_RXNE) != RESET) {
USART_ClearITPendingBit(USART1, USART_IT_RXNE);
}
}
void USART2_IRQHandler(void)
{
if(USART_GetITStatus(USART2, USART_IT_RXNE) != RESET)
{
if (USART_GetITStatus(USART2, USART_IT_RXNE) != RESET) {
USART_ClearITPendingBit(USART2, USART_IT_RXNE);
}
}
void USART3_IRQHandler(void)
{
if(USART_GetITStatus(USART3, USART_IT_RXNE) != RESET)
{
#if DEBUG_UART_USE_INTERRUPT // 如果开启 debug 串口中断
debug_interrupr_handler(); // 调用 debug 串口接收处理函数 数据会被 debug 环形缓冲区读取
#endif // 如果修改了 DEBUG_UART_INDEX 那这段代码需要放到对应的串口中断去
if (USART_GetITStatus(USART3, USART_IT_RXNE) != RESET) {
#if DEBUG_UART_USE_INTERRUPT // 如果开启 debug 串口中断
debug_interrupr_handler(); // 调用 debug 串口接收处理函数 数据会被 debug 环形缓冲区读取
#endif // 如果修改了 DEBUG_UART_INDEX 那这段代码需要放到对应的串口中断去
USART_ClearITPendingBit(USART3, USART_IT_RXNE);
}
}
void UART4_IRQHandler (void)
void UART4_IRQHandler(void)
{
if(USART_GetITStatus(UART4, USART_IT_RXNE) != RESET)
{
if (USART_GetITStatus(UART4, USART_IT_RXNE) != RESET) {
USART_ClearITPendingBit(UART4, USART_IT_RXNE);
}
}
void UART5_IRQHandler (void)
void UART5_IRQHandler(void)
{
if(USART_GetITStatus(UART5, USART_IT_RXNE) != RESET)
{
if (USART_GetITStatus(UART5, USART_IT_RXNE) != RESET) {
camera_uart_handler();
USART_ClearITPendingBit(UART5, USART_IT_RXNE);
}
}
void UART6_IRQHandler (void)
void UART6_IRQHandler(void)
{
if(USART_GetITStatus(UART6, USART_IT_RXNE) != RESET)
{
if (USART_GetITStatus(UART6, USART_IT_RXNE) != RESET) {
USART_ClearITPendingBit(UART6, USART_IT_RXNE);
}
}
void UART7_IRQHandler (void)
void UART7_IRQHandler(void)
{
if(USART_GetITStatus(UART7, USART_IT_RXNE) != RESET)
{
if (USART_GetITStatus(UART7, USART_IT_RXNE) != RESET) {
wireless_module_uart_handler();
USART_ClearITPendingBit(UART7, USART_IT_RXNE);
}
}
void UART8_IRQHandler (void)
void UART8_IRQHandler(void)
{
if(USART_GetITStatus(UART8, USART_IT_RXNE) != RESET)
{
if (USART_GetITStatus(UART8, USART_IT_RXNE) != RESET) {
gps_uart_callback();
USART_ClearITPendingBit(UART8, USART_IT_RXNE);
}
}
void DVP_IRQHandler(void)
{
if (DVP->IFR & RB_DVP_IF_FRM_DONE)
{
if (DVP->IFR & RB_DVP_IF_FRM_DONE) {
camera_dvp_handler();
DVP->IFR &= ~RB_DVP_IF_FRM_DONE;
}
}
void EXTI0_IRQHandler(void)
{
if(SET == EXTI_GetITStatus(EXTI_Line0))
{
if (SET == EXTI_GetITStatus(EXTI_Line0)) {
EXTI_ClearITPendingBit(EXTI_Line0);
}
}
void EXTI1_IRQHandler(void)
{
if(SET == EXTI_GetITStatus(EXTI_Line1))
{
if (SET == EXTI_GetITStatus(EXTI_Line1)) {
EXTI_ClearITPendingBit(EXTI_Line1);
}
}
void EXTI2_IRQHandler(void)
{
if(SET == EXTI_GetITStatus(EXTI_Line2))
{
if (SET == EXTI_GetITStatus(EXTI_Line2)) {
EXTI_ClearITPendingBit(EXTI_Line2);
}
}
void EXTI3_IRQHandler(void)
{
if(SET == EXTI_GetITStatus(EXTI_Line3))
{
if (SET == EXTI_GetITStatus(EXTI_Line3)) {
EXTI_ClearITPendingBit(EXTI_Line3);
}
}
void EXTI4_IRQHandler(void)
{
if(SET == EXTI_GetITStatus(EXTI_Line4))
{
if (SET == EXTI_GetITStatus(EXTI_Line4)) {
EXTI_ClearITPendingBit(EXTI_Line4);
}
}
void EXTI9_5_IRQHandler(void)
{
if(SET == EXTI_GetITStatus(EXTI_Line5))
{
if (SET == EXTI_GetITStatus(EXTI_Line5)) {
EXTI_ClearITPendingBit(EXTI_Line5);
}
if(SET == EXTI_GetITStatus(EXTI_Line6))
{
if (SET == EXTI_GetITStatus(EXTI_Line6)) {
EXTI_ClearITPendingBit(EXTI_Line6);
}
if(SET == EXTI_GetITStatus(EXTI_Line7))
{
if (SET == EXTI_GetITStatus(EXTI_Line7)) {
EXTI_ClearITPendingBit(EXTI_Line7);
}
if(SET == EXTI_GetITStatus(EXTI_Line8))
{
if (SET == EXTI_GetITStatus(EXTI_Line8)) {
EXTI_ClearITPendingBit(EXTI_Line8);
}
if(SET == EXTI_GetITStatus(EXTI_Line9))
{
if (SET == EXTI_GetITStatus(EXTI_Line9)) {
EXTI_ClearITPendingBit(EXTI_Line9);
if (SET == gpio_get_level(E10)) {
potate_button = POTATE_BUTTOM_BACKWARD;
} else {
potate_button = POTATE_BUTTOM_FOREWARD;
}
}
}
void EXTI15_10_IRQHandler(void)
{
if(SET == EXTI_GetITStatus(EXTI_Line10))
{
if (SET == EXTI_GetITStatus(EXTI_Line10)) {
// 此处编写用户代码 (A10/B10..E10) 引脚触发
@@ -242,18 +216,18 @@ void EXTI15_10_IRQHandler(void)
EXTI_ClearITPendingBit(EXTI_Line10);
}
if(SET == EXTI_GetITStatus(EXTI_Line11))
{
if (SET == EXTI_GetITStatus(EXTI_Line11)) {
EXTI_ClearITPendingBit(EXTI_Line11);
system_delay_us(200);
if (SET == !gpio_get_level(E11)) {
potate_button = POTATE_BUTTOM_PRESS;
}
}
if(SET == EXTI_GetITStatus(EXTI_Line12))
{
if (SET == EXTI_GetITStatus(EXTI_Line12)) {
EXTI_ClearITPendingBit(EXTI_Line12);
}
if(SET == EXTI_GetITStatus(EXTI_Line13))
{
if (SET == EXTI_GetITStatus(EXTI_Line13)) {
// -----------------* ToF INT 更新中断 预置中断处理函数 *-----------------
tof_module_exti_handler();
// -----------------* ToF INT 更新中断 预置中断处理函数 *-----------------
@@ -262,17 +236,14 @@ void EXTI15_10_IRQHandler(void)
// 此处编写用户代码 (A13/B13..E13) 引脚触发
EXTI_ClearITPendingBit(EXTI_Line13);
}
if(SET == EXTI_GetITStatus(EXTI_Line14))
{
if (SET == EXTI_GetITStatus(EXTI_Line14)) {
// -----------------* DM1XA 光信号 预置中断处理函数 *-----------------
dm1xa_light_callback();
// -----------------* DM1XA 光信号 预置中断处理函数 *-----------------
EXTI_ClearITPendingBit(EXTI_Line14);
}
if(SET == EXTI_GetITStatus(EXTI_Line15))
{
if (SET == EXTI_GetITStatus(EXTI_Line15)) {
// -----------------* DM1XA 声/反馈信号 预置中断处理函数 *-----------------
dm1xa_sound_callback();
// -----------------* DM1XA 声/反馈信号 预置中断处理函数 *-----------------
@@ -280,108 +251,76 @@ void EXTI15_10_IRQHandler(void)
}
}
void TIM1_UP_IRQHandler(void)
{
if(TIM_GetITStatus(TIM1, TIM_IT_Update) != RESET)
{
if (TIM_GetITStatus(TIM1, TIM_IT_Update) != RESET) {
TIM_ClearITPendingBit(TIM1, TIM_IT_Update);
}
}
void TIM2_IRQHandler(void)
{
if(TIM_GetITStatus(TIM2, TIM_IT_Update) != RESET)
{
TIM_ClearITPendingBit(TIM2, TIM_IT_Update );
if (TIM_GetITStatus(TIM2, TIM_IT_Update) != RESET) {
TIM_ClearITPendingBit(TIM2, TIM_IT_Update);
}
}
void TIM3_IRQHandler(void)
{
if(TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET)
{
TIM_ClearITPendingBit(TIM3, TIM_IT_Update );
if (TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET) {
TIM_ClearITPendingBit(TIM3, TIM_IT_Update);
}
}
void TIM4_IRQHandler(void)
{
if(TIM_GetITStatus(TIM4, TIM_IT_Update) != RESET)
{
TIM_ClearITPendingBit(TIM4, TIM_IT_Update );
if (TIM_GetITStatus(TIM4, TIM_IT_Update) != RESET) {
TIM_ClearITPendingBit(TIM4, TIM_IT_Update);
}
}
void TIM5_IRQHandler(void)
{
if(TIM_GetITStatus(TIM5, TIM_IT_Update) != RESET)
{
TIM_ClearITPendingBit(TIM5, TIM_IT_Update );
if (TIM_GetITStatus(TIM5, TIM_IT_Update) != RESET) {
TIM_ClearITPendingBit(TIM5, TIM_IT_Update);
}
}
void TIM6_IRQHandler(void)
{
if(TIM_GetITStatus(TIM6, TIM_IT_Update) != RESET)
{
TIM_ClearITPendingBit(TIM6, TIM_IT_Update );
if (TIM_GetITStatus(TIM6, TIM_IT_Update) != RESET) {
TIM_ClearITPendingBit(TIM6, TIM_IT_Update);
}
}
void TIM7_IRQHandler(void)
{
if(TIM_GetITStatus(TIM7, TIM_IT_Update) != RESET)
{
TIM_ClearITPendingBit(TIM7, TIM_IT_Update );
if (TIM_GetITStatus(TIM7, TIM_IT_Update) != RESET) {
TIM_ClearITPendingBit(TIM7, TIM_IT_Update);
}
}
void TIM8_UP_IRQHandler(void)
{
if(TIM_GetITStatus(TIM8, TIM_IT_Update) != RESET)
{
if (TIM_GetITStatus(TIM8, TIM_IT_Update) != RESET) {
TIM_ClearITPendingBit(TIM8, TIM_IT_Update);
}
}
void TIM9_UP_IRQHandler(void)
{
if(TIM_GetITStatus(TIM9, TIM_IT_Update) != RESET)
{
if (TIM_GetITStatus(TIM9, TIM_IT_Update) != RESET) {
TIM_ClearITPendingBit(TIM9, TIM_IT_Update);
}
}
void TIM10_UP_IRQHandler(void)
{
if(TIM_GetITStatus(TIM10, TIM_IT_Update) != RESET)
{
if (TIM_GetITStatus(TIM10, TIM_IT_Update) != RESET) {
TIM_ClearITPendingBit(TIM10, TIM_IT_Update);
}
}
//.section .text.vector_handler, "ax", @progbits
// .weak EXTI0_IRQHandler /* EXTI Line 0 */
@@ -468,26 +407,23 @@ void TIM10_UP_IRQHandler(void)
// .weak DMA2_Channel11_IRQHandler /* DMA2 Channel 11 */
/*******************************************************************************
* Function Name : NMI_Handler
* Description : This function handles NMI exception.
* Input : None
* Return : None
*******************************************************************************/
* Function Name : NMI_Handler
* Description : This function handles NMI exception.
* Input : None
* Return : None
*******************************************************************************/
void NMI_Handler(void)
{
}
/*******************************************************************************
* Function Name : HardFault_Handler
* Description : This function handles Hard Fault exception.
* Input : None
* Return : None
*******************************************************************************/
* Function Name : HardFault_Handler
* Description : This function handles Hard Fault exception.
* Input : None
* Return : None
*******************************************************************************/
void HardFault_Handler(void)
{
while (1)
{
}
while (1) {
}
}

View File

@@ -34,6 +34,8 @@
********************************************************************************************************************/
#include "zf_common_headfile.h"
#include "cw_servo.h"
#include "by_pt_button.h"
#include "by_fan_control.h"
uint8 mt9v03x_image_cp[MT9V03X_H][MT9V03X_W];
uint16_t pwm_cnt = 0;
@@ -44,23 +46,19 @@ int main(void)
debug_init(); // 务必保留本函数用于初始化MPU 时钟 调试串口
ips114_init();
// mt9v03x_init();
by_gpio_init();
by_exit_init();
by_pwm_init();
cw_servo_init();
// mt9v03x_init();
// 此处编写用户代码 例如外设初始化代码等
while (imu660ra_init()) {};
while (1) {
ips114_show_string(0, 0, "temperature");
imu660ra_get_temperature();
system_delay_ms(100);
ips114_show_float(0, 16, imu660ra_temperature, 3, 3);
// 此处编写需要循环执行的代码
system_delay_ms(50);
if (mt9v03x_finish_flag) {
memcpy(mt9v03x_image_cp[0], mt9v03x_image[0], sizeof(mt9v03x_image) / sizeof(uint8_t));
ips114_show_gray_image(0, 0, mt9v03x_image_cp[0], 188, 120, 188, 120, 0);
}
// 此处编写需要循环执行的代码
}
}