Bsongis/horus flash external device (#4446)
* CMake options changed to UNEXPECTED_SHUTDOWN=YES/NO and PWR_BUTTON=PRESS/SWITCH * [X12S / X10] Flash an external device is now OK
This commit is contained in:
committed by
Andre Bernet
parent
808d7749c7
commit
b9bb831b7f
@@ -1,7 +1,7 @@
|
||||
option(DISK_CACHE "Enable SD card disk cache" YES)
|
||||
option(BLUETOOTH_CLI_PASSTHROUGH "Enable direct communicaton with Bluetooth module from CLI" NO)
|
||||
option(PWR_BUTTON_DISABLED "Disable the Power Button (for debugging with JTAG)" NO)
|
||||
option(NO_UNEXPECTED_SHUTDOWN "Disable the Unexpected Shutdown screen (for debugging with JTAG)" NO)
|
||||
option(UNEXPECTED_SHUTDOWN "Enable the Unexpected Shutdown screen" YES)
|
||||
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
|
||||
|
||||
set(CPU_TYPE STM32F4)
|
||||
set(HSE_VALUE 12000000)
|
||||
@@ -22,14 +22,6 @@ if(SPLASH STREQUAL OFF)
|
||||
message(FATAL_ERROR "Option SPLASH=OFF not supported on Horus")
|
||||
endif()
|
||||
|
||||
if(PWR_BUTTON_DISABLED)
|
||||
add_definitions(-DPWR_BUTTON_DISABLED)
|
||||
endif()
|
||||
|
||||
if(NO_UNEXPECTED_SHUTDOWN)
|
||||
add_definitions(-DNO_UNEXPECTED_SHUTDOWN)
|
||||
endif()
|
||||
|
||||
if (PCB STREQUAL X10)
|
||||
set(FLAVOUR x10)
|
||||
add_definitions(-DPCBX10)
|
||||
@@ -68,6 +60,11 @@ endif()
|
||||
add_definitions(-DPCBHORUS -DSTM32F429_439xx -DSDRAM -DCOLORLCD -DPPM_PIN_UART -DPPM_PIN_TIMER)
|
||||
add_definitions(-DEEPROM_VARIANT=0 -DAUDIO -DVOICE -DRTCLOCK)
|
||||
add_definitions(-DGPS_USART_BAUDRATE=${INTERNAL_GPS_BAUDRATE})
|
||||
add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
|
||||
|
||||
if(NOT UNEXPECTED_SHUTDOWN)
|
||||
add_definitions(-DNO_UNEXPECTED_SHUTDOWN)
|
||||
endif()
|
||||
|
||||
include_directories(${RADIO_SRC_DIRECTORY}/fonts/480x272 gui/${GUI_DIR} gui/${GUI_DIR}/layouts)
|
||||
|
||||
|
||||
@@ -391,6 +391,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
// Power driver
|
||||
#define SOFT_PWR_CTRL
|
||||
void pwrInit(void);
|
||||
uint32_t pwrCheck(void);
|
||||
void pwrOn(void);
|
||||
@@ -398,7 +399,6 @@ void pwrOff(void);
|
||||
void pwrResetHandler(void);
|
||||
uint32_t pwrPressed(void);
|
||||
uint32_t pwrPressedDuration(void);
|
||||
#define pwroffPressed() pwrPressed()
|
||||
#if defined(SIMU) || defined(NO_UNEXPECTED_SHUTDOWN)
|
||||
#define UNEXPECTED_SHUTDOWN() (false)
|
||||
#else
|
||||
|
||||
@@ -46,11 +46,9 @@ void pwrInit()
|
||||
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
|
||||
#if !defined(PWR_BUTTON_DISABLED)
|
||||
// Init PWR SWITCH PIN
|
||||
GPIO_InitStructure.GPIO_Pin = PWR_SWITCH_GPIO_PIN;
|
||||
GPIO_Init(PWR_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
// Init PCBREV PIN
|
||||
// TODO to be removed on X10?
|
||||
@@ -101,11 +99,7 @@ void pwrOff()
|
||||
|
||||
uint32_t pwrPressed()
|
||||
{
|
||||
#if defined(PWR_BUTTON_DISABLED)
|
||||
return false;
|
||||
#else
|
||||
return GPIO_ReadInputDataBit(PWR_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET;
|
||||
#endif
|
||||
}
|
||||
|
||||
void pwrResetHandler()
|
||||
|
||||
Reference in New Issue
Block a user