想在串口中断中,将输入的数字写入ccr1寄存器,不能成功?
void USART1_IRQHandler(void)
{
uint8_t ch;
if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET)
{
//ch = USART1->DR;
ch = USART_ReceiveData(USART1);
TIM3->CCR1 =ch;
printf( "%c", ch );
}
是数据类型不对吗?
把 TIM3->CCR1 =ch;
改成 TIM3->CCR1 =3600;
就可以实现, |