pref: 将通信放入定时中断
This commit is contained in:
@@ -37,6 +37,8 @@
|
|||||||
#include "by_button.h"
|
#include "by_button.h"
|
||||||
#include "by_buzzer.h"
|
#include "by_buzzer.h"
|
||||||
#include "by_frame.h"
|
#include "by_frame.h"
|
||||||
|
#include "by_led.h"
|
||||||
|
#include "jj_param.h"
|
||||||
|
|
||||||
void NMI_Handler(void) __attribute__((interrupt()));
|
void NMI_Handler(void) __attribute__((interrupt()));
|
||||||
void HardFault_Handler(void) __attribute__((interrupt()));
|
void HardFault_Handler(void) __attribute__((interrupt()));
|
||||||
@@ -284,7 +286,9 @@ void EXTI15_10_IRQHandler(void)
|
|||||||
void TIM1_UP_IRQHandler(void)
|
void TIM1_UP_IRQHandler(void)
|
||||||
{
|
{
|
||||||
if (TIM_GetITStatus(TIM1, TIM_IT_Update) != RESET) {
|
if (TIM_GetITStatus(TIM1, TIM_IT_Update) != RESET) {
|
||||||
|
by_frame_send(2, &tiny_frame_param[0].u32);
|
||||||
TIM_ClearITPendingBit(TIM1, TIM_IT_Update);
|
TIM_ClearITPendingBit(TIM1, TIM_IT_Update);
|
||||||
|
by_led_warn_blink();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ int main(void)
|
|||||||
|
|
||||||
Page_Init();
|
Page_Init();
|
||||||
|
|
||||||
pit_ms_init(TIM1_PIT, 1);
|
pit_ms_init(TIM1_PIT, 10);
|
||||||
|
|
||||||
by_frame_init();
|
by_frame_init();
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ int main(void)
|
|||||||
tiny_frame_param[0].f32 = pure_angle;
|
tiny_frame_param[0].f32 = pure_angle;
|
||||||
tiny_frame_param[1].f32 = near_angle;
|
tiny_frame_param[1].f32 = near_angle;
|
||||||
// by_frame_parse(1, &tiny_frame_param[0].u32);
|
// by_frame_parse(1, &tiny_frame_param[0].u32);
|
||||||
by_frame_send(2, &tiny_frame_param[0].u32);
|
|
||||||
// uart_write_byte(BY_FRAME_UART_INDEX, a++);
|
// uart_write_byte(BY_FRAME_UART_INDEX, a++);
|
||||||
if (mt9v03x_finish_flag) {
|
if (mt9v03x_finish_flag) {
|
||||||
// 该操作消耗大概 1970 个 tick,折合约 110us
|
// 该操作消耗大概 1970 个 tick,折合约 110us
|
||||||
|
|||||||
Reference in New Issue
Block a user