cosmetics
This commit is contained in:
@@ -429,15 +429,6 @@ void telemetryPortInit()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void usbChargerInit()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool usbChargerLed()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void sportUpdatePowerOn()
|
void sportUpdatePowerOn()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -335,6 +335,7 @@ if(ROTARY_ENCODER)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USB_CHARGER)
|
if(USB_CHARGER)
|
||||||
|
set(TARGET_SRC ${TARGET_SRC} usb_charger_driver.cpp)
|
||||||
add_definitions(-DUSB_CHARGER)
|
add_definitions(-DUSB_CHARGER)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -41,24 +41,6 @@ void watchdogInit(unsigned int duration)
|
|||||||
IWDG->KR = 0xCCCC; // start
|
IWDG->KR = 0xCCCC; // start
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(USB_CHARGER)
|
|
||||||
void usbChargerInit()
|
|
||||||
{
|
|
||||||
GPIO_InitTypeDef GPIO_InitStructure;
|
|
||||||
GPIO_InitStructure.GPIO_Pin = USB_CHARGER_GPIO_PIN;
|
|
||||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
|
||||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
|
||||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
|
||||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
|
||||||
GPIO_Init(USB_CHARGER_GPIO, &GPIO_InitStructure);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool usbChargerLed()
|
|
||||||
{
|
|
||||||
return (GPIO_ReadInputDataBit(USB_CHARGER_GPIO, USB_CHARGER_GPIO_PIN) == Bit_RESET && usbPlugged());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(SPORT_UPDATE_PWR_GPIO)
|
#if defined(SPORT_UPDATE_PWR_GPIO)
|
||||||
void sportUpdateInit()
|
void sportUpdateInit()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -864,10 +864,8 @@ void bluetoothDisable();
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// USB Charger
|
// USB Charger
|
||||||
#if defined(USB_CHARGER)
|
|
||||||
void usbChargerInit();
|
void usbChargerInit();
|
||||||
bool usbChargerLed();
|
bool usbChargerLed();
|
||||||
#endif
|
|
||||||
|
|
||||||
// LED driver
|
// LED driver
|
||||||
void ledInit();
|
void ledInit();
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* 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 "opentx.h"
|
||||||
|
|
||||||
|
void usbChargerInit()
|
||||||
|
{
|
||||||
|
GPIO_InitTypeDef GPIO_InitStructure;
|
||||||
|
GPIO_InitStructure.GPIO_Pin = USB_CHARGER_GPIO_PIN;
|
||||||
|
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||||
|
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
|
||||||
|
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||||
|
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||||
|
GPIO_Init(USB_CHARGER_GPIO, &GPIO_InitStructure);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool usbChargerLed()
|
||||||
|
{
|
||||||
|
return (GPIO_ReadInputDataBit(USB_CHARGER_GPIO, USB_CHARGER_GPIO_PIN) == Bit_RESET && usbPlugged());
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user