@@ -192,10 +192,7 @@ void boardInit()
|
||||
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE, true);
|
||||
#endif
|
||||
|
||||
#if !defined(PCBX9E)
|
||||
// some X9E boards need that the pwrInit() is moved a little bit later
|
||||
pwrInit();
|
||||
#endif
|
||||
|
||||
#if defined(STATUS_LEDS)
|
||||
ledInit();
|
||||
@@ -247,7 +244,7 @@ void boardInit()
|
||||
#if defined(PWR_BUTTON_PRESS)
|
||||
if (!WAS_RESET_BY_WATCHDOG_OR_SOFTWARE()) {
|
||||
lcdClear();
|
||||
#if defined(PCBX9E)
|
||||
#if LCD_DEPTH > 1
|
||||
lcdDrawBitmap(76, 2, bmp_lock, 0, 60);
|
||||
#else
|
||||
lcdDrawFilledRect(LCD_W / 2 - 18, LCD_H / 2 - 3, 6, 6, SOLID, 0);
|
||||
@@ -263,7 +260,7 @@ void boardInit()
|
||||
if (duration < PWR_PRESS_DURATION_MIN) {
|
||||
unsigned index = duration / (PWR_PRESS_DURATION_MIN / 4);
|
||||
lcdClear();
|
||||
#if defined(PCBX9E)
|
||||
#if LCD_DEPTH > 1
|
||||
lcdDrawBitmap(76, 2, bmp_startup, index*60, 60);
|
||||
#else
|
||||
for(uint8_t i= 0; i < 4; i++) {
|
||||
@@ -280,7 +277,7 @@ void boardInit()
|
||||
else {
|
||||
if (pwr_on != 1) {
|
||||
pwr_on = 1;
|
||||
pwrInit();
|
||||
pwrOn();
|
||||
backlightInit();
|
||||
haptic.play(15, 3, PLAY_NOW);
|
||||
}
|
||||
@@ -293,15 +290,17 @@ void boardInit()
|
||||
}
|
||||
}
|
||||
else {
|
||||
pwrInit();
|
||||
pwrOn();
|
||||
backlightInit();
|
||||
}
|
||||
#else // defined(PWR_BUTTON_PRESS)
|
||||
pwrOn();
|
||||
backlightInit();
|
||||
#endif
|
||||
|
||||
#if defined(TOPLCD_GPIO)
|
||||
toplcdInit();
|
||||
#endif
|
||||
#else // defined(PWR_BUTTON_PRESS)
|
||||
backlightInit();
|
||||
#endif
|
||||
|
||||
if (HAS_SPORT_UPDATE_CONNECTOR()) {
|
||||
sportUpdateInit();
|
||||
|
||||
@@ -22,14 +22,18 @@
|
||||
|
||||
void boardPreInit()
|
||||
{
|
||||
#if defined(INTMODULE_BOOTCMD_GPIO)
|
||||
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;
|
||||
|
||||
// Board PWR kept OFF
|
||||
GPIO_ResetBits(PWR_ON_GPIO, PWR_ON_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = PWR_ON_GPIO_PIN;
|
||||
GPIO_Init(PWR_ON_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_Init(INTMODULE_BOOTCMD_GPIO, &GPIO_InitStructure);
|
||||
|
||||
@@ -23,12 +23,11 @@
|
||||
void pwrInit()
|
||||
{
|
||||
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_ResetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = INTMODULE_PWR_GPIO_PIN;
|
||||
GPIO_Init(INTMODULE_PWR_GPIO, &GPIO_InitStructure);
|
||||
@@ -58,21 +57,10 @@ void pwrInit()
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
|
||||
GPIO_Init(PCBREV_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
pwrOn();
|
||||
}
|
||||
|
||||
void pwrOn()
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user