1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 04:45:24 +03:00

initial pass at gpio cleanup. removed almost all dependency on stdperiphlib (remaining exti).

slightly modified initial pin configuration, but this needs rework soon anyway.
couple spacing/line ending/formatting fixes in sonar driver file while fixing gpio there.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@357 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
timecop@gmail.com 2013-06-29 14:09:54 +00:00
parent eec35a20fd
commit d442c9dfb6
18 changed files with 2174 additions and 2096 deletions

View file

@ -266,16 +266,15 @@ static void pwmICConfig(TIM_TypeDef *tim, uint8_t channel, uint16_t polarity)
static void pwmGPIOConfig(GPIO_TypeDef *gpio, uint32_t pin, uint8_t input)
{
GPIO_InitTypeDef GPIO_InitStructure;
gpio_config_t cfg;
GPIO_StructInit(&GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = pin;
cfg.pin = pin;
if (input)
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPD;
cfg.mode = Mode_IPD;
else
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(gpio, &GPIO_InitStructure);
cfg.mode = Mode_AF_PP;
cfg.speed = Speed_2MHz;
gpioInit(gpio, &cfg);
}
static pwmPortData_t *pwmOutConfig(uint8_t port, uint16_t period, uint16_t value)