2024-11-30 10:27:03 +08:00
|
|
|
|
#include "stdio.h"
|
|
|
|
|
|
|
|
|
|
#include "stm32f10x.h"
|
|
|
|
|
#include "stm32f10x_tim.h"
|
|
|
|
|
#include "stm32f10x_usart.h"
|
|
|
|
|
|
|
|
|
|
#include "mw_soft_timer.h"
|
|
|
|
|
#include "mw_printf.h"
|
|
|
|
|
|
2025-01-22 13:22:25 +08:00
|
|
|
|
// void TIM2_IRQHandler(void) // TIM3 interrupt
|
|
|
|
|
// {
|
|
|
|
|
// if(TIM_GetITStatus(TIM2, TIM_IT_Update) != RESET)
|
|
|
|
|
// {
|
|
|
|
|
// // Ӳ<><D3B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<EFBFBD><31><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0
|
|
|
|
|
// TIM_ClearITPendingBit(TIM2, TIM_IT_Update);
|
|
|
|
|
// /* add your code here */
|
|
|
|
|
// mw_soft_timer_user_systick_update();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2024-11-30 10:27:03 +08:00
|
|
|
|
|
|
|
|
|
void USART1_IRQHandler(void)
|
|
|
|
|
{
|
|
|
|
|
// uint16_t usart_tx_data;
|
|
|
|
|
uint8_t usart_rx_data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(USART_GetITStatus(USART1, USART_IT_TC) != RESET)
|
|
|
|
|
{
|
|
|
|
|
// USART_SendData(USART1, )
|
2024-12-17 22:12:53 +08:00
|
|
|
|
USART_ClearITPendingBit(USART1, USART_IT_TC); // clear flag
|
2024-11-30 10:27:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)
|
|
|
|
|
{
|
|
|
|
|
// USART_SendData(USART1, )
|
2024-12-17 22:12:53 +08:00
|
|
|
|
USART_ClearITPendingBit(USART1, USART_IT_RXNE); // clear flag
|
2024-11-30 10:27:03 +08:00
|
|
|
|
usart_rx_data = (uint8_t)(USART_ReceiveData(USART1));
|
|
|
|
|
mw_printf_insert_data(usart_rx_data);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|