取消422接口
This commit is contained in:
parent
10116dddec
commit
f03154b2f7
|
@ -79,18 +79,18 @@ static void usart_config(uint32_t usart_periph, int baud)
|
|||
gpio_output_options_set(GPIOD, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ,GPIO_PIN_7);
|
||||
break;
|
||||
|
||||
case UART_422://串口2,422
|
||||
//使能端口时钟
|
||||
rcu_periph_clock_enable(RCU_GPIOD);
|
||||
//使能串口时钟
|
||||
rcu_periph_clock_enable(RCU_USART2);
|
||||
gpio_af_set(GPIOD, GPIO_AF_7, GPIO_PIN_8);//TX
|
||||
gpio_af_set(GPIOD, GPIO_AF_7, GPIO_PIN_9);//RX
|
||||
gpio_mode_set(GPIOD, GPIO_MODE_AF, GPIO_PUPD_NONE,GPIO_PIN_8);
|
||||
gpio_output_options_set(GPIOD, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ,GPIO_PIN_8);
|
||||
gpio_mode_set(GPIOD, GPIO_MODE_AF, GPIO_PUPD_NONE,GPIO_PIN_9);
|
||||
gpio_output_options_set(GPIOD, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ,GPIO_PIN_9);
|
||||
break;
|
||||
// case UART_422://串口2,422
|
||||
// //使能端口时钟
|
||||
// rcu_periph_clock_enable(RCU_GPIOD);
|
||||
// //使能串口时钟
|
||||
// rcu_periph_clock_enable(RCU_USART2);
|
||||
// gpio_af_set(GPIOD, GPIO_AF_7, GPIO_PIN_8);//TX
|
||||
// gpio_af_set(GPIOD, GPIO_AF_7, GPIO_PIN_9);//RX
|
||||
// gpio_mode_set(GPIOD, GPIO_MODE_AF, GPIO_PUPD_NONE,GPIO_PIN_8);
|
||||
// gpio_output_options_set(GPIOD, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ,GPIO_PIN_8);
|
||||
// gpio_mode_set(GPIOD, GPIO_MODE_AF, GPIO_PUPD_NONE,GPIO_PIN_9);
|
||||
// gpio_output_options_set(GPIOD, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ,GPIO_PIN_9);
|
||||
// break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -128,9 +128,9 @@ static void Usart_Nvic_config(uint32_t usart_periph)
|
|||
nvic_irq_enable(USART1_IRQn, 1, 2);//优先级配置为3,子优先及为1
|
||||
break;
|
||||
|
||||
case UART_422://串口2,422
|
||||
nvic_irq_enable(USART2_IRQn, 1, 1);//优先级配置为3,子优先及为2
|
||||
break;
|
||||
// case UART_422://串口2,422
|
||||
// nvic_irq_enable(USART2_IRQn, 1, 1);//优先级配置为3,子优先及为2
|
||||
// break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
@ -177,12 +177,12 @@ static void Uart_Init(void)
|
|||
BSP_IntVectSet(54,USART1_IRQHandler);
|
||||
BSP_IntEn(54);
|
||||
|
||||
///422串口设备初始化
|
||||
usart_config(UART_422, g_ptz.uart_422_baud);//串口初始化
|
||||
Usart_Nvic_config(UART_422);//中断配置
|
||||
uart_422_handle = uart_init(UART_422, PTZ_UART_422_INDEX, ptz_uart_422_buff, sizeof(ptz_uart_422_buff));
|
||||
BSP_IntVectSet(55,USART2_IRQHandler);
|
||||
BSP_IntEn(55);
|
||||
// ///422串口设备初始化
|
||||
// usart_config(UART_422, g_ptz.uart_422_baud);//串口初始化
|
||||
// Usart_Nvic_config(UART_422);//中断配置
|
||||
// uart_422_handle = uart_init(UART_422, PTZ_UART_422_INDEX, ptz_uart_422_buff, sizeof(ptz_uart_422_buff));
|
||||
// BSP_IntVectSet(55,USART2_IRQHandler);
|
||||
// BSP_IntEn(55);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -188,23 +188,23 @@ void USART1_IRQHandler(void)
|
|||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief USART2 中断处理函数
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
\note LH @2022.05.20
|
||||
*/
|
||||
void USART2_IRQHandler(void)
|
||||
{
|
||||
u_int8_t c = 0;
|
||||
// /*!
|
||||
// \brief USART2 中断处理函数
|
||||
// \param[in] none
|
||||
// \param[out] none
|
||||
// \retval none
|
||||
// \note LH @2022.05.20
|
||||
// */
|
||||
// void USART2_IRQHandler(void)
|
||||
// {
|
||||
// u_int8_t c = 0;
|
||||
|
||||
c = usart_data_receive(USART2);//读相应串口数据
|
||||
// c = usart_data_receive(USART2);//读相应串口数据
|
||||
|
||||
IRQHandler_422_process(c);
|
||||
// IRQHandler_422_process(c);
|
||||
|
||||
usart_interrupt_flag_clear(USART2 , USART_INT_FLAG_RBNE);
|
||||
}
|
||||
// usart_interrupt_flag_clear(USART2 , USART_INT_FLAG_RBNE);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue