mirror of
https://github.com/opentx/opentx.git
synced 2025-07-14 11:59:50 +03:00
Fixes #6707 (reboot issue on X9E)
This commit is contained in:
parent
73ae084016
commit
995aa8708a
4 changed files with 19 additions and 7 deletions
|
@ -209,9 +209,8 @@ int main()
|
|||
|
||||
RCC_APB2PeriphClockCmd(LCD_RCC_APB2Periph | BACKLIGHT_RCC_APB2Periph | RCC_APB2Periph_SYSCFG, ENABLE);
|
||||
|
||||
keysInit();
|
||||
pwrInit();
|
||||
pwrOff();
|
||||
keysInit();
|
||||
|
||||
#if defined(PCBHORUS)
|
||||
// wait a bit for the inputs to stabilize...
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "pwr.h"
|
||||
#include "board.h"
|
||||
|
||||
void pwrInit()
|
||||
|
@ -67,12 +66,12 @@ void pwrInit()
|
|||
// TRAINER DETECT PIN
|
||||
GPIO_InitStructure.GPIO_Pin = TRAINER_DETECT_GPIO_PIN;
|
||||
GPIO_Init(TRAINER_DETECT_GPIO, &GPIO_InitStructure);
|
||||
|
||||
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;
|
||||
|
|
|
@ -75,6 +75,16 @@ void pwrInit()
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,9 @@ defined in linker script */
|
|||
.type Reset_Handler, %function
|
||||
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
|
||||
b LoopCopyDataInit
|
||||
|
||||
|
@ -111,8 +113,10 @@ LoopPaintMainStack:
|
|||
|
||||
/* Call the clock system intitialization function.*/
|
||||
bl SystemInit
|
||||
|
||||
/* Call C++ constructors for static objects */
|
||||
bl __libc_init_array
|
||||
bl __libc_init_array
|
||||
|
||||
/* Call the application's entry point.*/
|
||||
bl main
|
||||
bx lr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue