1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-13 19:40:20 +03:00

Fixes #6707 (reboot issue on X9E)

This commit is contained in:
Bertrand Songis 2019-09-04 12:55:03 +02:00
parent 73ae084016
commit 995aa8708a
No known key found for this signature in database
GPG key ID: F189F79290FEC50F
4 changed files with 19 additions and 7 deletions

View file

@ -209,9 +209,8 @@ int main()
RCC_APB2PeriphClockCmd(LCD_RCC_APB2Periph | BACKLIGHT_RCC_APB2Periph | RCC_APB2Periph_SYSCFG, ENABLE); RCC_APB2PeriphClockCmd(LCD_RCC_APB2Periph | BACKLIGHT_RCC_APB2Periph | RCC_APB2Periph_SYSCFG, ENABLE);
keysInit();
pwrInit(); pwrInit();
pwrOff(); keysInit();
#if defined(PCBHORUS) #if defined(PCBHORUS)
// wait a bit for the inputs to stabilize... // wait a bit for the inputs to stabilize...

View file

@ -18,7 +18,6 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include "pwr.h"
#include "board.h" #include "board.h"
void pwrInit() void pwrInit()
@ -67,12 +66,12 @@ void pwrInit()
// TRAINER DETECT PIN // TRAINER DETECT PIN
GPIO_InitStructure.GPIO_Pin = TRAINER_DETECT_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = TRAINER_DETECT_GPIO_PIN;
GPIO_Init(TRAINER_DETECT_GPIO, &GPIO_InitStructure); GPIO_Init(TRAINER_DETECT_GPIO, &GPIO_InitStructure);
pwrOn();
} }
void pwrOn() void pwrOn()
{ {
// we keep the init of the PIN to have pwrOn as quick as possible
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = PWR_ON_GPIO_PIN; GPIO_InitStructure.GPIO_Pin = PWR_ON_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;

View file

@ -75,6 +75,16 @@ void pwrInit()
void pwrOn() void pwrOn()
{ {
// we keep the init of the PIN to have pwrOn as quick as possible
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = PWR_ON_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(PWR_ON_GPIO, &GPIO_InitStructure);
GPIO_SetBits(PWR_ON_GPIO, PWR_ON_GPIO_PIN); GPIO_SetBits(PWR_ON_GPIO, PWR_ON_GPIO_PIN);
} }

View file

@ -71,7 +71,9 @@ defined in linker script */
.type Reset_Handler, %function .type Reset_Handler, %function
Reset_Handler: Reset_Handler:
/* Copy the data segment initializers from flash to SRAM */ bl pwrResetHandler /*jump to WDT reset handler where soft power control pin is turned on as soon as possible */
/* Copy the data segment initializers from flash to SRAM */
movs r1, #0 movs r1, #0
b LoopCopyDataInit b LoopCopyDataInit
@ -111,8 +113,10 @@ LoopPaintMainStack:
/* Call the clock system intitialization function.*/ /* Call the clock system intitialization function.*/
bl SystemInit bl SystemInit
/* Call C++ constructors for static objects */ /* Call C++ constructors for static objects */
bl __libc_init_array bl __libc_init_array
/* Call the application's entry point.*/ /* Call the application's entry point.*/
bl main bl main
bx lr bx lr