update
This commit is contained in:
@@ -8,34 +8,33 @@ bsp_uart_t *com_to_uart[APP_COM_NUM] =
|
||||
&com_uart4,
|
||||
&com_uart2,
|
||||
&com_uart3,
|
||||
&com_uart1,
|
||||
&com_uart6,
|
||||
};
|
||||
|
||||
static void app_com_uart_baud_rate_set(app_com_class_t * p_com,u16 baud_rate);
|
||||
static void app_com_uart_class_rate_set(app_com_class_t * p_com,u16 baud_rate);
|
||||
static void app_com_class_update(void );
|
||||
static void app_com_init(app_com_class_t * p_com);
|
||||
static void app_com_init(void);
|
||||
|
||||
app_com_t app_com=
|
||||
{
|
||||
|
||||
.init = app_com_init,
|
||||
.class_update = app_com_class_update,
|
||||
};
|
||||
|
||||
static void app_com_init(app_com_class_t * p_com)
|
||||
static void app_com_init(void)
|
||||
{
|
||||
if(p_com == &app_com.com[APP_COM1])
|
||||
p_com->com_uart = com_to_uart[APP_COM1];
|
||||
else if(p_com == &app_com.com[APP_COM2])
|
||||
p_com->com_uart = com_to_uart[APP_COM2];
|
||||
else if(p_com == &app_com.com[APP_COM3])
|
||||
p_com->com_uart = com_to_uart[APP_COM3];
|
||||
else if(p_com == &app_com.com[APP_COM4])
|
||||
p_com->com_uart = com_to_uart[APP_COM4];
|
||||
u8 i;
|
||||
for(i=0;i<APP_COM_NUM;i++)
|
||||
{
|
||||
app_com.com[i].com_uart = com_to_uart[i];
|
||||
}
|
||||
app_com_class_update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
||||
static void app_com_uart_baud_rate_set(app_com_class_t * p_com,u16 baud_rate)
|
||||
static void app_com_class_baud_rate_set(app_com_class_t * p_com,u16 baud_rate)
|
||||
{
|
||||
p_com->com_uart->set.baud_rate(p_com->com_uart,baud_rate);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user