1.驱动优化。
This commit is contained in:
@@ -162,7 +162,7 @@ static struct mr_adc_ops adc_drv_ops =
|
||||
drv_adc_read
|
||||
};
|
||||
|
||||
static struct mr_drv adc_drv[mr_array_num(adc_drv_data)] =
|
||||
static struct mr_drv adc_drv[] =
|
||||
{
|
||||
#ifdef MR_USING_ADC1
|
||||
{
|
||||
|
||||
@@ -316,7 +316,7 @@ static struct mr_i2c_bus_ops i2c_bus_drv_ops =
|
||||
drv_i2c_bus_write,
|
||||
};
|
||||
|
||||
static struct mr_drv i2c_bus_drv[mr_array_num(i2c_bus_drv_data)] =
|
||||
static struct mr_drv i2c_bus_drv[] =
|
||||
{
|
||||
#ifdef MR_USING_I2C1
|
||||
{
|
||||
|
||||
@@ -360,7 +360,6 @@ static ssize_t drv_serial_write(struct mr_serial *serial, const uint8_t *buf, si
|
||||
int i = 0;
|
||||
|
||||
/* Write data */
|
||||
USART_SendData(serial_data->instance, buf[wr_size]);
|
||||
while (USART_GetFlagStatus(serial_data->instance, USART_FLAG_TC) == RESET)
|
||||
{
|
||||
i++;
|
||||
@@ -369,6 +368,7 @@ static ssize_t drv_serial_write(struct mr_serial *serial, const uint8_t *buf, si
|
||||
return wr_size;
|
||||
}
|
||||
}
|
||||
USART_SendData(serial_data->instance, buf[wr_size]);
|
||||
}
|
||||
return wr_size;
|
||||
}
|
||||
@@ -447,7 +447,7 @@ static struct mr_serial_ops serial_drv_ops =
|
||||
drv_serial_stop_tx
|
||||
};
|
||||
|
||||
static struct mr_drv serial_drv[mr_array_num(serial_drv_data)] =
|
||||
static struct mr_drv serial_drv[] =
|
||||
{
|
||||
#ifdef MR_USING_UART1
|
||||
{
|
||||
|
||||
@@ -380,7 +380,7 @@ static struct mr_spi_bus_ops spi_bus_drv_ops =
|
||||
drv_spi_bus_write,
|
||||
};
|
||||
|
||||
static struct mr_drv spi_bus_drv[mr_array_num(spi_bus_drv_data)] =
|
||||
static struct mr_drv spi_bus_drv[] =
|
||||
{
|
||||
#ifdef MR_USING_SPI1
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user