1.优化keil文件不最后不加一行报警告的问题。
This commit is contained in:
@@ -147,4 +147,4 @@ mr_err_t drv_adc_init(void)
|
||||
}
|
||||
MR_INIT_DRIVER_EXPORT(drv_adc_init);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -29,4 +29,4 @@ struct drv_adc_data
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _DRV_ADC_H_ */
|
||||
#endif /* _DRV_ADC_H_ */
|
||||
|
||||
@@ -29,4 +29,4 @@ struct drv_dac_data
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _DRV_DAC_H_ */
|
||||
#endif /* _DRV_DAC_H_ */
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
#include "device/pin.h"
|
||||
#include "mrboard.h"
|
||||
|
||||
#endif /* _DRV_GPIO_H_ */
|
||||
#endif /* _DRV_GPIO_H_ */
|
||||
|
||||
@@ -31,4 +31,4 @@ struct drv_soft_i2c_bus_data
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _DRV_I2C_H_ */
|
||||
#endif /* _DRV_I2C_H_ */
|
||||
|
||||
@@ -41,38 +41,41 @@ enum
|
||||
};
|
||||
|
||||
static struct ch32_pwm_data ch32_pwm_data[] =
|
||||
{
|
||||
{
|
||||
#ifdef MR_BSP_PWM_1
|
||||
{"pwm1",TIM1,RCC_APB2Periph_TIM1,RCC_APB2Periph_GPIOA,GPIOA,GPIO_Pin_8,GPIO_Pin_9,GPIO_Pin_10,GPIO_Pin_11},
|
||||
{"pwm1", TIM1, RCC_APB2Periph_TIM1, RCC_APB2Periph_GPIOA, GPIOA, GPIO_Pin_8, GPIO_Pin_9, GPIO_Pin_10,
|
||||
GPIO_Pin_11},
|
||||
#endif
|
||||
#ifdef MR_BSP_PWM_2
|
||||
{"pwm2",TIM2,RCC_APB1Periph_TIM2,RCC_APB2Periph_GPIOA,GPIOA,GPIO_Pin_0,GPIO_Pin_1,GPIO_Pin_2,GPIO_Pin_3},
|
||||
{"pwm2", TIM2, RCC_APB1Periph_TIM2, RCC_APB2Periph_GPIOA, GPIOA, GPIO_Pin_0, GPIO_Pin_1, GPIO_Pin_2,
|
||||
GPIO_Pin_3},
|
||||
#endif
|
||||
#ifdef MR_BSP_PWM_3
|
||||
{"pwm3",TIM3,RCC_APB1Periph_TIM3,RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB,GPIOA,GPIO_Pin_6,GPIO_Pin_7,},
|
||||
{"pwm3", TIM3, RCC_APB1Periph_TIM3, RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB, GPIOA, GPIO_Pin_6,
|
||||
GPIO_Pin_7,},
|
||||
#endif
|
||||
#ifdef MR_BSP_PWM_4
|
||||
{"pwm4",TIM4,RCC_APB1Periph_TIM4,RCC_APB2Periph_GPIOD},
|
||||
{"pwm4", TIM4, RCC_APB1Periph_TIM4, RCC_APB2Periph_GPIOD},
|
||||
#endif
|
||||
#ifdef MR_BSP_PWM_5
|
||||
{"pwm5",TIM5,RCC_APB1Periph_TIM5},
|
||||
{"pwm5", TIM5, RCC_APB1Periph_TIM5},
|
||||
#endif
|
||||
#ifdef MR_BSP_PWM_6
|
||||
{"pwm6",TIM6,RCC_APB1Periph_TIM6},
|
||||
{"pwm6", TIM6, RCC_APB1Periph_TIM6},
|
||||
#endif
|
||||
#ifdef MR_BSP_PWM_7
|
||||
{"pwm7",TIM7,RCC_APB1Periph_TIM7},
|
||||
{"pwm7", TIM7, RCC_APB1Periph_TIM7},
|
||||
#endif
|
||||
#ifdef MR_BSP_PWM_8
|
||||
{"pwm8",TIM8,RCC_APB2Periph_TIM8},
|
||||
{"pwm8", TIM8, RCC_APB2Periph_TIM8},
|
||||
#endif
|
||||
#ifdef MR_BSP_PWM_9
|
||||
{"pwm9",TIM9,RCC_APB2Periph_TIM9},
|
||||
{"pwm9", TIM9, RCC_APB2Periph_TIM9},
|
||||
#endif
|
||||
#ifdef MR_BSP_PWM_10
|
||||
{"pwm10",TIM10,RCC_APB2Periph_TIM10},
|
||||
{"pwm10", TIM10, RCC_APB2Periph_TIM10},
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
static struct mr_pwm pwm_device[mr_array_num(ch32_pwm_data)];
|
||||
|
||||
@@ -94,11 +97,11 @@ static mr_uint32_t ch32_pwm_read(mr_pwm_t pwm, mr_off_t channel)
|
||||
mr_err_t drv_pwm_init(void)
|
||||
{
|
||||
static struct mr_pwm_ops drv_ops =
|
||||
{
|
||||
ch32_pwm_configure,
|
||||
ch32_pwm_write,
|
||||
ch32_pwm_read,
|
||||
};
|
||||
{
|
||||
ch32_pwm_configure,
|
||||
ch32_pwm_write,
|
||||
ch32_pwm_read,
|
||||
};
|
||||
mr_size_t count = mr_array_num(pwm_device);
|
||||
mr_err_t ret = MR_ERR_OK;
|
||||
|
||||
@@ -106,8 +109,8 @@ mr_err_t drv_pwm_init(void)
|
||||
{
|
||||
ret = mr_pwm_device_add(&pwm_device[count],
|
||||
ch32_pwm_data[count].name,
|
||||
&drv_ops,&ch32_pwm_data[count]
|
||||
);
|
||||
&drv_ops, &ch32_pwm_data[count]
|
||||
);
|
||||
MR_ASSERT(ret == MR_ERR_OK);
|
||||
}
|
||||
|
||||
@@ -115,4 +118,4 @@ mr_err_t drv_pwm_init(void)
|
||||
}
|
||||
MR_INIT_DRIVER_EXPORT(drv_pwm_init);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -368,4 +368,4 @@ mr_err_t drv_spi_bus_init(void)
|
||||
}
|
||||
MR_INIT_DRIVER_EXPORT(drv_spi_bus_init);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -35,4 +35,4 @@ struct drv_spi_bus_data
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _DRV_SPI_H_ */
|
||||
#endif /* _DRV_SPI_H_ */
|
||||
|
||||
@@ -313,4 +313,4 @@ mr_err_t drv_timer_init(void)
|
||||
}
|
||||
MR_INIT_DRIVER_EXPORT(drv_timer_init);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -30,4 +30,4 @@ struct drv_timer_data
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _DRV_TIMER_H_ */
|
||||
#endif /* _DRV_TIMER_H_ */
|
||||
|
||||
@@ -240,7 +240,6 @@ static mr_uint8_t drv_serial_read(mr_serial_t serial)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return uart_data->instance->DATAR & 0xff;
|
||||
}
|
||||
|
||||
@@ -362,4 +361,4 @@ mr_err_t drv_uart_init(void)
|
||||
}
|
||||
MR_INIT_DRIVER_EXPORT(drv_uart_init);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -35,4 +35,4 @@ struct drv_uart_data
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _DRV_UART_H_ */
|
||||
#endif /* _DRV_UART_H_ */
|
||||
|
||||
@@ -18,4 +18,4 @@ void mr_delay_us(mr_size_t us)
|
||||
void mr_delay_ms(mr_size_t ms)
|
||||
{
|
||||
Delay_Ms(ms);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,4 +45,4 @@
|
||||
#include "drv_timer.h"
|
||||
#endif
|
||||
|
||||
#endif /* _MR_DRV_H_ */
|
||||
#endif /* _MR_DRV_H_ */
|
||||
|
||||
Reference in New Issue
Block a user