Merge with latest 2.3
This commit is contained in:
@@ -122,11 +122,20 @@ if(PCB STREQUAL X10 OR PCB STREQUAL X12S OR PCB STREQUAL NV14)
|
||||
../../../../../syscalls.c
|
||||
)
|
||||
|
||||
if(USB_CHARGER)
|
||||
set(BOOTLOADER_SRC
|
||||
${BOOTLOADER_SRC}
|
||||
../../../../../targets/${TARGET_DIR}/usb_charger_driver.cpp
|
||||
../../../../../targets/${TARGET_DIR}/led_driver.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(DEBUG)
|
||||
set(BOOTLOADER_SRC
|
||||
${BOOTLOADER_SRC}
|
||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c
|
||||
../../../../../serial.cpp
|
||||
../../../../../targets/common/arm/stm32/aux_serial_driver.cpp
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
|
||||
@@ -205,11 +205,26 @@ int main()
|
||||
AUX_SERIAL_RCC_APB1Periph |
|
||||
SD_RCC_APB1Periph, ENABLE);
|
||||
|
||||
RCC_APB2PeriphClockCmd(LCD_RCC_APB2Periph | BACKLIGHT_RCC_APB2Periph | RCC_APB2Periph_SYSCFG, ENABLE);
|
||||
RCC_APB2PeriphClockCmd(LCD_RCC_APB2Periph | BACKLIGHT_RCC_APB2Periph | RCC_APB2Periph_SYSCFG | AUX_SERIAL_RCC_APB2Periph, ENABLE);
|
||||
|
||||
pwrInit();
|
||||
keysInit();
|
||||
|
||||
// USB charger handling
|
||||
#if defined(USB_CHARGER)
|
||||
if (!WAS_RESET_BY_WATCHDOG_OR_SOFTWARE() && !pwrPressed()) {
|
||||
ledInit();
|
||||
usbChargerInit();
|
||||
ledOff();
|
||||
while (!pwrPressed()) {
|
||||
if(usbChargerLed())
|
||||
GPIO_SetBits(LED_GPIO, LED_GREEN_GPIO_PIN);
|
||||
else
|
||||
ledOff();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// wait a bit for the inputs to stabilize...
|
||||
if (!WAS_RESET_BY_WATCHDOG_OR_SOFTWARE()) {
|
||||
for (uint32_t i = 0; i < 150000; i++) {
|
||||
|
||||
Reference in New Issue
Block a user