mirror of
https://github.com/opentx/opentx.git
synced 2025-07-14 03:49:52 +03:00
BootCmd should be always high
This commit is contained in:
parent
8819259144
commit
f1867cccb2
6 changed files with 41 additions and 7 deletions
|
@ -70,6 +70,7 @@ set(BOOTLOADER_SRC
|
|||
../../../../../targets/${TARGET_DIR}/backlight_driver.cpp
|
||||
../../../../../targets/${TARGET_DIR}/keys_driver.cpp
|
||||
../../../../../targets/${TARGET_DIR}/diskio.cpp
|
||||
../../../../../targets/${TARGET_DIR}/board_preinit.cpp
|
||||
../../../../../targets/${TARGET_DIR}/pwr_driver.cpp
|
||||
../../../../../targets/${TARGET_DIR}/bootloader/boot_menu.cpp
|
||||
../usbd_usr.cpp
|
||||
|
|
|
@ -219,6 +219,8 @@ int main()
|
|||
rotaryEncoderInit();
|
||||
#endif
|
||||
|
||||
boardPreInit();
|
||||
|
||||
// wait for inputs to stabilize
|
||||
for (uint32_t i = 0; i < 50000; i += 1) {
|
||||
wdt_reset();
|
||||
|
|
|
@ -34,6 +34,7 @@ extern uint16_t ResetReason;
|
|||
#define FIRMWARE_ADDRESS 0x00400000
|
||||
|
||||
// Board driver
|
||||
void boardPreInit(void);
|
||||
void boardInit(void);
|
||||
#define boardOff() pwrOff()
|
||||
|
||||
|
|
|
@ -114,6 +114,7 @@ extern "C" {
|
|||
extern uint16_t sessionTimer;
|
||||
|
||||
// Board driver
|
||||
void boardPreInit(void);
|
||||
void boardInit(void);
|
||||
void boardOff(void);
|
||||
|
||||
|
|
36
radio/src/targets/taranis/board_preinit.cpp
Normal file
36
radio/src/targets/taranis/board_preinit.cpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
|
||||
void boardPreInit()
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
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;
|
||||
|
||||
#if defined(INTMODULE_BOOTCMD_GPIO)
|
||||
GPIO_SetBits(INTMODULE_BOOTCMD_GPIO, INTMODULE_BOOTCMD_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = INTMODULE_BOOTCMD_GPIO_PIN;
|
||||
GPIO_Init(INTMODULE_BOOTCMD_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
}
|
|
@ -37,13 +37,6 @@ void pwrInit()
|
|||
GPIO_InitStructure.GPIO_Pin = EXTMODULE_PWR_GPIO_PIN;
|
||||
GPIO_Init(EXTMODULE_PWR_GPIO, &GPIO_InitStructure);
|
||||
|
||||
#if defined(INTMODULE_BOOTCMD_GPIO)
|
||||
GPIO_SetBits(INTMODULE_BOOTCMD_GPIO, INTMODULE_BOOTCMD_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = INTMODULE_BOOTCMD_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_Init(INTMODULE_BOOTCMD_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
#if defined(PCBREV_GPIO_PIN)
|
||||
GPIO_ResetBits(PCBREV_GPIO, PCBREV_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = PCBREV_GPIO_PIN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue