📄 systick_irq.c
字号:
#include <stm32f10x_lib.h> /* STM32F10x Library Definitions */
#include "UET_GPIO.h"
unsigned char Clock1s;
extern unsigned short int ADC_ConvertedValue;
extern int SendChar (int ch) ;
static unsigned int receved_data;
//*SysTick interrupt happens every 10 ms
void SysTick_Handler (void)
{
static unsigned long ticks;
//static unsigned long timetick;
//static unsigned char leds=0x01;
if (ticks++ >= 99) { // Set Clock1s to 1 every 1 second
ticks = 0;
Clock1s = 1;
}
;
}
void USART1_IRQHandler(void)
{
if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)
{
/* Read one byte from the receive data register */
receved_data=(USART_ReceiveData(USART1));
/* Clear the USART1 Receive interrupt */
USART_ClearITPendingBit(USART1, USART_IT_RXNE);
SendChar(receved_data);
}
if(USART_GetITStatus(USART1, USART_IT_TXE) != RESET)
{SendChar(0x95);//for debug;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -