mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 12:55:19 +03:00
Continuation of extracting peripheral configuration into drivers.
This commit is contained in:
parent
78ca635d26
commit
32622da0ab
17 changed files with 186 additions and 108 deletions
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include "platform.h"
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
#define AIRCR_VECTKEY_MASK ((uint32_t)0x05FA0000)
|
||||
|
||||
void systemReset(bool toBootloader)
|
||||
|
@ -18,3 +20,17 @@ void systemReset(bool toBootloader)
|
|||
// Generate system reset
|
||||
SCB->AIRCR = AIRCR_VECTKEY_MASK | (uint32_t)0x04;
|
||||
}
|
||||
|
||||
|
||||
void enableGPIOPowerUsageAndNoiseReductions(void)
|
||||
{
|
||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC, ENABLE);
|
||||
|
||||
gpio_config_t gpio;
|
||||
|
||||
gpio.mode = Mode_AIN;
|
||||
gpio.pin = Pin_All;
|
||||
gpioInit(GPIOA, &gpio);
|
||||
gpioInit(GPIOB, &gpio);
|
||||
gpioInit(GPIOC, &gpio);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue