FuriHal: RTC recovery routine and ext3v3 enabled on start (#1357)

* FuriHal: leave ext3v3 enabled on start
* FuriHal: RTC recovery routine, cleanup resources

Co-authored-by: SG <who.just.the.doctor@gmail.com>
This commit is contained in:
あく
2022-07-04 17:26:02 +03:00
committed by GitHub
parent b95cd2df14
commit c495677eb5
4 changed files with 88 additions and 40 deletions

View File

@@ -58,7 +58,7 @@ const GpioPin gpio_i2c_power_scl = {.port = GPIOA, .pin = LL_GPIO_PIN_9};
const GpioPin gpio_speaker = {.port = GPIOB, .pin = LL_GPIO_PIN_8};
const GpioPin periph_power = {.port = PERIPH_POWER_GPIO_Port, .pin = PERIPH_POWER_Pin};
const GpioPin periph_power = {.port = GPIOA, .pin = LL_GPIO_PIN_3};
const GpioPin gpio_usb_dm = {.port = GPIOA, .pin = LL_GPIO_PIN_11};
const GpioPin gpio_usb_dp = {.port = GPIOA, .pin = LL_GPIO_PIN_12};
@@ -77,6 +77,10 @@ const size_t input_pins_count = sizeof(input_pins) / sizeof(InputPin);
void furi_hal_resources_init_early() {
furi_hal_gpio_init(&gpio_button_left, GpioModeInput, GpioPullUp, GpioSpeedLow);
// SD Card stepdown control
furi_hal_gpio_write(&periph_power, 1);
furi_hal_gpio_init(&periph_power, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
// Display pins
furi_hal_gpio_write(&gpio_display_rst_n, 1);
furi_hal_gpio_init_simple(&gpio_display_rst_n, GpioModeOutputPushPull);
@@ -142,8 +146,6 @@ void furi_hal_resources_init() {
furi_hal_gpio_init(&gpio_rf_sw_0, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
furi_hal_gpio_init(&periph_power, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
NVIC_SetPriority(EXTI0_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(), 5, 0));
NVIC_EnableIRQ(EXTI0_IRQn);