diff --git a/src/x9d/board_x9d.h b/src/x9d/board_x9d.h index 0fecfdf09..6ad0f2330 100644 --- a/src/x9d/board_x9d.h +++ b/src/x9d/board_x9d.h @@ -151,6 +151,10 @@ void pwrInit(); uint32_t pwrCheck(); void pwrOff(); #define UNEXPECTED_SHUTDOWN() (g_eeGeneral.unexpectedShutdown) +#define INTERNAL_RF_ON() GPIO_SetBits(GPIOPWR, PIN_INT_RF_PWR) +#define INTERNAL_RF_OFF() GPIO_ResetBits(GPIOPWR, PIN_INT_RF_PWR) +#define EXTERNAL_RF_ON() GPIO_SetBits(GPIOPWR, PIN_EXT_RF_PWR) +#define INTERNAL_RF_OFF() GPIO_ResetBits(GPIOPWR, PIN_EXT_RF_PWR) // Backlight driver #define setBacklight(xx) diff --git a/src/x9d/hal.h b/src/x9d/hal.h index 3c6a823d5..071b64241 100644 --- a/src/x9d/hal.h +++ b/src/x9d/hal.h @@ -158,6 +158,8 @@ #define GPIOPWR GPIOD #define GPIOTRNDET GPIOA #define PIN_TRNDET GPIO_Pin_8 +#define PIN_INT_RF_PWR GPIO_Pin_15 +#define PIN_EXT_RF_PWR GPIO_Pin_8 // Trainer Port #define PIN_TR_PPM_IN GPIO_Pin_8 //PC.08 diff --git a/src/x9d/pwr_driver.cpp b/src/x9d/pwr_driver.cpp index 3fab5d494..9ca20636f 100644 --- a/src/x9d/pwr_driver.cpp +++ b/src/x9d/pwr_driver.cpp @@ -86,8 +86,16 @@ void pwrInit() GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ; GPIO_Init(GPIOPWRLED, &GPIO_InitStructure); + +#if !defined(REV3) + GPIO_ResetBits(GPIOPWR, PIN_INT_RF_PWR | PIN_EXT_RF_PWR); + GPIO_InitStructure.GPIO_Pin = PIN_INT_RF_PWR | PIN_EXT_RF_PWR; + GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; + GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; + GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; + GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ; + GPIO_Init(GPIOPWR, &GPIO_InitStructure); -#if !defined(REV3) GPIO_InitStructure.GPIO_Pin = PIN_TRNDET; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;