[X9D] Fixes #3758 (not tested)
This commit is contained in:
@@ -139,8 +139,6 @@ void boardInit()
|
|||||||
i2cInit();
|
i2cInit();
|
||||||
usbInit();
|
usbInit();
|
||||||
|
|
||||||
modulesInit();
|
|
||||||
|
|
||||||
#if defined(HAPTIC)
|
#if defined(HAPTIC)
|
||||||
hapticInit();
|
hapticInit();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -158,7 +158,6 @@ uint32_t isFirmwareStart(const void * buffer);
|
|||||||
uint32_t isBootloaderStart(const void * buffer);
|
uint32_t isBootloaderStart(const void * buffer);
|
||||||
|
|
||||||
// Pulses driver
|
// Pulses driver
|
||||||
void modulesInit(void);
|
|
||||||
#define INTERNAL_MODULE_ON() GPIO_SetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN)
|
#define INTERNAL_MODULE_ON() GPIO_SetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN)
|
||||||
#define INTERNAL_MODULE_OFF() GPIO_ResetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN)
|
#define INTERNAL_MODULE_OFF() GPIO_ResetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN)
|
||||||
#define EXTERNAL_MODULE_ON() GPIO_SetBits(EXTMODULE_PWR_GPIO, EXTMODULE_PWR_GPIO_PIN)
|
#define EXTERNAL_MODULE_ON() GPIO_SetBits(EXTMODULE_PWR_GPIO, EXTMODULE_PWR_GPIO_PIN)
|
||||||
|
|||||||
@@ -39,25 +39,6 @@ void extmoduleCrossfireStart(void);
|
|||||||
|
|
||||||
void intmoduleSendNextFrame();
|
void intmoduleSendNextFrame();
|
||||||
|
|
||||||
void modulesInit()
|
|
||||||
{
|
|
||||||
GPIO_InitTypeDef GPIO_InitStructure;
|
|
||||||
|
|
||||||
GPIO_ResetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN);
|
|
||||||
GPIO_InitStructure.GPIO_Pin = INTMODULE_PWR_GPIO_PIN;
|
|
||||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
|
||||||
GPIO_Init(INTMODULE_PWR_GPIO, &GPIO_InitStructure);
|
|
||||||
|
|
||||||
GPIO_ResetBits(EXTMODULE_PWR_GPIO, EXTMODULE_PWR_GPIO_PIN);
|
|
||||||
GPIO_InitStructure.GPIO_Pin = EXTMODULE_PWR_GPIO_PIN;
|
|
||||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
|
|
||||||
GPIO_Init(EXTMODULE_PWR_GPIO, &GPIO_InitStructure);
|
|
||||||
|
|
||||||
GPIO_InitStructure.GPIO_Pin = TRAINER_DETECT_GPIO_PIN;
|
|
||||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
|
||||||
GPIO_Init(TRAINER_DETECT_GPIO, &GPIO_InitStructure);
|
|
||||||
}
|
|
||||||
|
|
||||||
void init_pxx(uint32_t port)
|
void init_pxx(uint32_t port)
|
||||||
{
|
{
|
||||||
if (port == INTERNAL_MODULE)
|
if (port == INTERNAL_MODULE)
|
||||||
|
|||||||
@@ -18,8 +18,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pwr.h"
|
#include "opentx.h"
|
||||||
#include "board.h"
|
|
||||||
|
|
||||||
void pwrInit()
|
void pwrInit()
|
||||||
{
|
{
|
||||||
@@ -33,11 +32,22 @@ void pwrInit()
|
|||||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||||
GPIO_Init(PWR_GPIO, &GPIO_InitStructure);
|
GPIO_Init(PWR_GPIO, &GPIO_InitStructure);
|
||||||
|
|
||||||
|
GPIO_ResetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN);
|
||||||
|
GPIO_InitStructure.GPIO_Pin = INTMODULE_PWR_GPIO_PIN;
|
||||||
|
GPIO_Init(INTMODULE_PWR_GPIO, &GPIO_InitStructure);
|
||||||
|
|
||||||
|
GPIO_ResetBits(EXTMODULE_PWR_GPIO, EXTMODULE_PWR_GPIO_PIN);
|
||||||
|
GPIO_InitStructure.GPIO_Pin = EXTMODULE_PWR_GPIO_PIN;
|
||||||
|
GPIO_Init(EXTMODULE_PWR_GPIO, &GPIO_InitStructure);
|
||||||
|
|
||||||
GPIO_InitStructure.GPIO_Pin = PWR_SWITCH_GPIO_PIN;
|
GPIO_InitStructure.GPIO_Pin = PWR_SWITCH_GPIO_PIN;
|
||||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||||
GPIO_Init(PWR_GPIO, &GPIO_InitStructure);
|
GPIO_Init(PWR_GPIO, &GPIO_InitStructure);
|
||||||
|
|
||||||
|
GPIO_InitStructure.GPIO_Pin = TRAINER_DETECT_GPIO_PIN;
|
||||||
|
GPIO_Init(TRAINER_DETECT_GPIO, &GPIO_InitStructure);
|
||||||
|
|
||||||
pwrOn();
|
pwrOn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user