Merge with latest 2.3
This commit is contained in:
@@ -3,6 +3,7 @@ set_property(CACHE TIMERS PROPERTY STRINGS 2 3)
|
||||
option(CLI "Command Line Interface" OFF)
|
||||
option(DEBUG "Debug mode" OFF)
|
||||
option(LOG_TELEMETRY "Telemetry Logs on SD card" OFF)
|
||||
option(LOG_BLUETOOTH "Bluetooth Logs on SD card" OFF)
|
||||
option(TRACE_SD_CARD "Traces SD enabled" OFF)
|
||||
option(TRACE_FATFS "Traces FatFS enabled" OFF)
|
||||
option(TRACE_AUDIO "Traces audio enabled" OFF)
|
||||
@@ -32,6 +33,10 @@ if(LOG_TELEMETRY)
|
||||
add_definitions(-DLOG_TELEMETRY)
|
||||
endif()
|
||||
|
||||
if(LOG_BLUETOOTH)
|
||||
add_definitions(-DLOG_BLUETOOTH)
|
||||
endif()
|
||||
|
||||
if(TRACE_SD_CARD)
|
||||
add_definitions(-DTRACE_SD_CARD)
|
||||
set(DEBUG ON)
|
||||
|
||||
@@ -88,33 +88,61 @@ void dacInit()
|
||||
NVIC_SetPriority(AUDIO_DMA_Stream_IRQn, 7);
|
||||
}
|
||||
|
||||
#if defined(AUDIO_MUTE_GPIO_PIN)
|
||||
void audioMute()
|
||||
{
|
||||
#if defined(AUDIO_UNMUTE_DELAY)
|
||||
tmr10ms_t now = get_tmr10ms();
|
||||
if (!audioQueue.lastAudioPlayTime) {
|
||||
// we start the mute delay now
|
||||
audioQueue.lastAudioPlayTime = now;
|
||||
}
|
||||
else if (now - audioQueue.lastAudioPlayTime > AUDIO_MUTE_DELAY / 10) {
|
||||
// delay expired, we may mute
|
||||
GPIO_SetBits(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN);
|
||||
}
|
||||
#else
|
||||
// mute
|
||||
GPIO_SetBits(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN);
|
||||
#endif
|
||||
}
|
||||
|
||||
void audioUnmute()
|
||||
{
|
||||
#if defined(AUDIO_UNMUTE_DELAY)
|
||||
// if muted
|
||||
if (GPIO_ReadOutputDataBit(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN)) {
|
||||
// ..un-mute
|
||||
GPIO_ResetBits(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN);
|
||||
RTOS_WAIT_MS(AUDIO_UNMUTE_DELAY);
|
||||
}
|
||||
// reset the mute delay
|
||||
audioQueue.lastAudioPlayTime = 0;
|
||||
#else
|
||||
GPIO_ResetBits(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void audioConsumeCurrentBuffer()
|
||||
{
|
||||
if (!nextBuffer) {
|
||||
nextBuffer = audioQueue.buffersFifo.getNextFilledBuffer();
|
||||
if (nextBuffer) {
|
||||
#if defined(AUDIO_MUTE_GPIO_PIN)
|
||||
// if muted
|
||||
if (GPIO_ReadOutputDataBit(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN)) {
|
||||
// ..un-mute
|
||||
GPIO_ResetBits(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN);
|
||||
#if defined(AUDIO_UNMUTE_DELAY)
|
||||
RTOS_WAIT_MS(AUDIO_UNMUTE_DELAY);
|
||||
audioUnmute();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
AUDIO_DMA_Stream->CR &= ~DMA_SxCR_EN ; // Disable DMA channel
|
||||
AUDIO_DMA->HIFCR = DMA_HIFCR_CTCIF5 | DMA_HIFCR_CHTIF5 | DMA_HIFCR_CTEIF5 | DMA_HIFCR_CDMEIF5 | DMA_HIFCR_CFEIF5 ; // Write ones to clear bits
|
||||
AUDIO_DMA_Stream->CR &= ~DMA_SxCR_EN; // Disable DMA channel
|
||||
AUDIO_DMA->HIFCR = DMA_HIFCR_CTCIF5 | DMA_HIFCR_CHTIF5 | DMA_HIFCR_CTEIF5 | DMA_HIFCR_CDMEIF5 | DMA_HIFCR_CFEIF5; // Write ones to clear bits
|
||||
AUDIO_DMA_Stream->M0AR = CONVERT_PTR_UINT(nextBuffer->data);
|
||||
AUDIO_DMA_Stream->NDTR = nextBuffer->size;
|
||||
AUDIO_DMA_Stream->CR |= DMA_SxCR_EN | DMA_SxCR_TCIE ; // Enable DMA channel and interrupt
|
||||
DAC->SR = DAC_SR_DMAUDR1 ; // Write 1 to clear flag
|
||||
DAC->CR |= DAC_CR_EN1 | DAC_CR_DMAEN1 ; // Enable DAC
|
||||
AUDIO_DMA_Stream->CR |= DMA_SxCR_EN | DMA_SxCR_TCIE; // Enable DMA channel and interrupt
|
||||
DAC->SR = DAC_SR_DMAUDR1; // Write 1 to clear flag
|
||||
DAC->CR |= DAC_CR_EN1 | DAC_CR_DMAEN1; // Enable DAC
|
||||
}
|
||||
#if defined(AUDIO_MUTE_GPIO_PIN)
|
||||
else {
|
||||
// mute
|
||||
GPIO_SetBits(AUDIO_MUTE_GPIO, AUDIO_MUTE_GPIO_PIN);
|
||||
audioMute();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -107,6 +107,12 @@ void bluetoothInit(uint32_t baudrate, bool enable)
|
||||
void bluetoothDisable()
|
||||
{
|
||||
GPIO_SetBits(BT_EN_GPIO, BT_EN_GPIO_PIN); // close bluetooth (recent modules will go to bootloader mode)
|
||||
USART_ITConfig(BT_USART, USART_IT_RXNE, DISABLE);
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
GPIO_InitStructure.GPIO_Pin = BT_RX_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
GPIO_Init(BT_USART_GPIO, &GPIO_InitStructure);
|
||||
USART_DeInit(BT_USART);
|
||||
}
|
||||
|
||||
extern "C" void BT_USART_IRQHandler(void)
|
||||
|
||||
@@ -74,7 +74,7 @@ set(BOOTLOADER_SRC
|
||||
../../../../../targets/${TARGET_DIR}/keys_driver.cpp
|
||||
../../../../../targets/${TARGET_DIR}/diskio.cpp
|
||||
../../../../../targets/${TARGET_DIR}/board.cpp
|
||||
../../../../../targets/${TARGET_DIR}/pwr_driver.cpp
|
||||
../pwr_driver.cpp
|
||||
../../../../../targets/${TARGET_DIR}/bootloader/boot_menu.cpp
|
||||
../usbd_usr.cpp
|
||||
../usbd_storage_msd.cpp
|
||||
@@ -142,6 +142,7 @@ remove_definitions(-DDEBUG)
|
||||
remove_definitions(-DDISK_CACHE)
|
||||
remove_definitions(-DLUA)
|
||||
remove_definitions(-DCLI)
|
||||
remove_definitions(-DSEMIHOSTING)
|
||||
remove_definitions(-DUSB_SERIAL)
|
||||
remove_definitions(-DWATCHDOG)
|
||||
|
||||
|
||||
+18
-12
@@ -23,17 +23,14 @@
|
||||
void pwrInit()
|
||||
{
|
||||
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
|
||||
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);
|
||||
INIT_INTMODULE_BOOTCMD_PIN();
|
||||
GPIO_InitStructure.GPIO_Pin = INTMODULE_BOOTCMD_GPIO_PIN;
|
||||
GPIO_Init(INTMODULE_BOOTCMD_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
@@ -54,23 +51,32 @@ void pwrInit()
|
||||
GPIO_InitStructure.GPIO_Pin = PWR_SWITCH_GPIO_PIN;
|
||||
GPIO_Init(PWR_SWITCH_GPIO, &GPIO_InitStructure);
|
||||
|
||||
#if defined(PCBREV_HARDCODED)
|
||||
hardwareOptions.pcbrev = PCBREV_HARDCODED;
|
||||
#elif defined(PCBREV_GPIO_PIN)
|
||||
GPIO_ResetBits(PCBREV_GPIO, PCBREV_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = PCBREV_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
|
||||
GPIO_Init(PCBREV_GPIO, &GPIO_InitStructure);
|
||||
hardwareOptions.pcbrev = PCBREV_VALUE();
|
||||
#endif
|
||||
|
||||
#if defined(TRAINER_DETECT_GPIO_PIN)
|
||||
GPIO_InitStructure.GPIO_Pin = TRAINER_DETECT_GPIO_PIN;
|
||||
GPIO_Init(TRAINER_DETECT_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
#if defined(SD_PRESENT_GPIO_PIN)
|
||||
GPIO_ResetBits(SD_PRESENT_GPIO, SD_PRESENT_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = SD_PRESENT_GPIO_PIN;
|
||||
GPIO_Init(SD_PRESENT_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
#if defined(INTMODULE_USART) && defined(TRAINER_MODULE_CPPM_GPIO_PIN)
|
||||
GPIO_SetBits(TRAINER_MODULE_CPPM_GPIO, TRAINER_MODULE_CPPM_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = TRAINER_MODULE_CPPM_GPIO_PIN;
|
||||
GPIO_Init(TRAINER_MODULE_CPPM_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
#if defined(PCBREV_GPIO_PIN)
|
||||
GPIO_ResetBits(PCBREV_GPIO, PCBREV_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = PCBREV_GPIO_PIN;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
|
||||
GPIO_Init(PCBREV_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
}
|
||||
|
||||
void pwrOn()
|
||||
@@ -175,7 +175,7 @@ set(FIRMWARE_TARGET_SRC
|
||||
${LCD_DRIVER}
|
||||
board.cpp
|
||||
backlight_driver.cpp
|
||||
pwr_driver.cpp
|
||||
../common/arm/stm32/pwr_driver.cpp
|
||||
sdram_driver.c
|
||||
startup_stm32f42_43xxx.s
|
||||
../common/arm/stm32/heartbeat_driver.cpp
|
||||
|
||||
@@ -41,10 +41,6 @@ void watchdogInit(unsigned int duration)
|
||||
IWDG->KR = 0xCCCC; // start
|
||||
}
|
||||
|
||||
#if defined(SEMIHOSTING)
|
||||
extern "C" void initialise_monitor_handles();
|
||||
#endif
|
||||
|
||||
#if defined(PCBX10) && !defined(RADIO_T16)
|
||||
void sportUpdateInit()
|
||||
{
|
||||
@@ -70,10 +66,6 @@ void sportUpdatePowerOff()
|
||||
|
||||
void boardInit()
|
||||
{
|
||||
#if defined(SEMIHOSTING)
|
||||
initialise_monitor_handles();
|
||||
#endif
|
||||
|
||||
RCC_AHB1PeriphClockCmd(PWR_RCC_AHB1Periph |
|
||||
PCBREV_RCC_AHB1Periph |
|
||||
LED_RCC_AHB1Periph |
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
#include "hal.h"
|
||||
|
||||
PACK(typedef struct {
|
||||
uint8_t pcbrev : 2;
|
||||
uint8_t sticksPwmDisabled : 1;
|
||||
uint8_t pxx2Enabled : 1;
|
||||
uint8_t pcbrev:2;
|
||||
uint8_t sticksPwmDisabled:1;
|
||||
uint8_t pxx2Enabled:1;
|
||||
}) HardwareOptions;
|
||||
|
||||
extern HardwareOptions hardwareOptions;
|
||||
|
||||
@@ -310,10 +310,15 @@ DRESULT disk_ioctl (
|
||||
// TODO everything here should not be in the driver layer ...
|
||||
|
||||
FATFS g_FATFS_Obj __DMA; // initialized in boardInit()
|
||||
|
||||
#if defined(LOG_TELEMETRY)
|
||||
FIL g_telemetryFile = {};
|
||||
#endif
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
FIL g_bluetoothFile = {};
|
||||
#endif
|
||||
|
||||
#if defined(BOOT)
|
||||
void sdInit(void)
|
||||
{
|
||||
@@ -350,6 +355,13 @@ void sdMount()
|
||||
f_lseek(&g_telemetryFile, f_size(&g_telemetryFile)); // append
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
f_open(&g_bluetoothFile, LOGS_PATH "/bluetooth.log", FA_OPEN_ALWAYS | FA_WRITE);
|
||||
if (f_size(&g_bluetoothFile) > 0) {
|
||||
f_lseek(&g_bluetoothFile, f_size(&g_bluetoothFile)); // append
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
TRACE("f_mount() failed");
|
||||
@@ -362,9 +374,15 @@ void sdDone()
|
||||
|
||||
if (sdMounted()) {
|
||||
audioQueue.stopSD();
|
||||
|
||||
#if defined(LOG_TELEMETRY)
|
||||
f_close(&g_telemetryFile);
|
||||
#endif
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
f_close(&g_bluetoothFile);
|
||||
#endif
|
||||
|
||||
f_mount(nullptr, "", 0); // unmount SD
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,24 +120,24 @@
|
||||
// Gimbal switch left
|
||||
#define STORAGE_SWITCH_I
|
||||
#define HARDWARE_SWITCH_I
|
||||
#define SWITCHES_GPIO_REG_I GPIOH->IDR
|
||||
#define SWITCHES_GPIO_PIN_I GPIO_Pin_14 // PH.14
|
||||
#define SWITCHES_GPIO_REG_I GPIOH->IDR
|
||||
#define SWITCHES_GPIO_PIN_I GPIO_Pin_14 // PH.14
|
||||
// Gimbal switch right
|
||||
#define STORAGE_SWITCH_J
|
||||
#define HARDWARE_SWITCH_J
|
||||
#define SWITCHES_GPIO_REG_J GPIOH->IDR
|
||||
#define SWITCHES_GPIO_PIN_J GPIO_Pin_15 // PH.15
|
||||
#define SWITCHES_GPIO_REG_J GPIOH->IDR
|
||||
#define SWITCHES_GPIO_PIN_J GPIO_Pin_15 // PH.15
|
||||
#elif defined(PCBX12S)
|
||||
// Gimbal switch left
|
||||
#define STORAGE_SWITCH_I
|
||||
#define HARDWARE_SWITCH_I
|
||||
#define SWITCHES_GPIO_REG_I GPIOB->IDR
|
||||
#define SWITCHES_GPIO_PIN_I GPIO_Pin_1 // PB.01
|
||||
#define SWITCHES_GPIO_REG_I GPIOB->IDR
|
||||
#define SWITCHES_GPIO_PIN_I GPIO_Pin_1 // PB.01
|
||||
// Gimbal switch right
|
||||
#define STORAGE_SWITCH_J
|
||||
#define HARDWARE_SWITCH_J
|
||||
#define SWITCHES_GPIO_REG_J GPIOB->IDR
|
||||
#define SWITCHES_GPIO_PIN_J GPIO_Pin_0 // PB.00
|
||||
#define SWITCHES_GPIO_REG_J GPIOB->IDR
|
||||
#define SWITCHES_GPIO_PIN_J GPIO_Pin_0 // PB.00
|
||||
#endif
|
||||
|
||||
// Trims
|
||||
@@ -184,15 +184,15 @@
|
||||
#define TRIMS_GPIO_REG_RHR GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_RHR GPIO_Pin_7 // PD.07
|
||||
#if defined(RADIO_T16)
|
||||
#define TRIMS_GPIO_REG_LSU GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_LSU GPIO_Pin_13 // PD.13
|
||||
#define TRIMS_GPIO_REG_LSD GPIOJ->IDR
|
||||
#define TRIMS_GPIO_PIN_LSD GPIO_Pin_8 // PJ.08
|
||||
#define TRIMS_GPIO_REG_LSU GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_LSU GPIO_Pin_13 // PD.13
|
||||
#define TRIMS_GPIO_REG_LSD GPIOJ->IDR
|
||||
#define TRIMS_GPIO_PIN_LSD GPIO_Pin_8 // PJ.08
|
||||
#else
|
||||
#define TRIMS_GPIO_REG_LSU GPIOJ->IDR
|
||||
#define TRIMS_GPIO_PIN_LSU GPIO_Pin_8 // PJ.08
|
||||
#define TRIMS_GPIO_REG_LSD GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_LSD GPIO_Pin_13 // PD.13
|
||||
#define TRIMS_GPIO_REG_LSU GPIOJ->IDR
|
||||
#define TRIMS_GPIO_PIN_LSU GPIO_Pin_8 // PJ.08
|
||||
#define TRIMS_GPIO_REG_LSD GPIOD->IDR
|
||||
#define TRIMS_GPIO_PIN_LSD GPIO_Pin_13 // PD.13
|
||||
#endif
|
||||
#define TRIMS_GPIO_REG_RSU GPIOB->IDR
|
||||
#define TRIMS_GPIO_PIN_RSU GPIO_Pin_14 // PB.14
|
||||
@@ -288,11 +288,11 @@
|
||||
#define ADC_DMA_Stream DMA2_Stream0
|
||||
#define ADC_SET_DMA_FLAGS() ADC_DMA->LIFCR = (DMA_LIFCR_CTCIF0 | DMA_LIFCR_CHTIF0 | DMA_LIFCR_CTEIF0 | DMA_LIFCR_CDMEIF0 | DMA_LIFCR_CFEIF0)
|
||||
#define ADC_TRANSFER_COMPLETE() (ADC_DMA->LISR & DMA_LISR_TCIF0)
|
||||
#if defined(RADIO_T16)
|
||||
#define ADC_VREF_PREC2 300
|
||||
#else
|
||||
#define ADC_VREF_PREC2 250
|
||||
#endif
|
||||
#if defined(RADIO_T16)
|
||||
#define ADC_VREF_PREC2 300
|
||||
#else
|
||||
#define ADC_VREF_PREC2 250
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Power
|
||||
@@ -316,15 +316,15 @@
|
||||
|
||||
// PCBREV
|
||||
#if defined(PCBX10)
|
||||
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOH
|
||||
#define PCBREV_GPIO_PIN (GPIO_Pin_7 | GPIO_Pin_8)
|
||||
#define PCBREV_GPIO GPIOH
|
||||
#define PCBREV_VALUE() (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_7) + (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_8) << 1))
|
||||
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOH
|
||||
#define PCBREV_GPIO_PIN (GPIO_Pin_7 | GPIO_Pin_8)
|
||||
#define PCBREV_GPIO GPIOH
|
||||
#define PCBREV_VALUE() (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_7) + (GPIO_ReadInputDataBit(PCBREV_GPIO, GPIO_Pin_8) << 1))
|
||||
#else
|
||||
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOI
|
||||
#define PCBREV_GPIO GPIOI
|
||||
#define PCBREV_GPIO_PIN GPIO_Pin_11 // PI.11
|
||||
#define PCBREV_VALUE() GPIO_ReadInputDataBit(PCBREV_GPIO, PCBREV_GPIO_PIN)
|
||||
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOI
|
||||
#define PCBREV_GPIO GPIOI
|
||||
#define PCBREV_GPIO_PIN GPIO_Pin_11 // PI.11
|
||||
#define PCBREV_VALUE() GPIO_ReadInputDataBit(PCBREV_GPIO, PCBREV_GPIO_PIN)
|
||||
#endif
|
||||
|
||||
// Led
|
||||
@@ -344,22 +344,22 @@
|
||||
|
||||
// Serial Port (DEBUG)
|
||||
#if defined(PCBX12S)
|
||||
#define AUX_SERIAL_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_DMA1)
|
||||
#define AUX_SERIAL_RCC_APB1Periph RCC_APB1Periph_USART3
|
||||
#define AUX_SERIAL_GPIO GPIOB
|
||||
#define AUX_SERIAL_GPIO_PIN_TX GPIO_Pin_10 // PB.10
|
||||
#define AUX_SERIAL_GPIO_PIN_RX GPIO_Pin_11 // PB.11
|
||||
#define AUX_SERIAL_GPIO_PinSource_TX GPIO_PinSource10
|
||||
#define AUX_SERIAL_GPIO_PinSource_RX GPIO_PinSource11
|
||||
#define AUX_SERIAL_GPIO_AF GPIO_AF_USART3
|
||||
#define AUX_SERIAL_USART USART3
|
||||
#define AUX_SERIAL_USART_IRQHandler USART3_IRQHandler
|
||||
#define AUX_SERIAL_USART_IRQn USART3_IRQn
|
||||
#define AUX_SERIAL_DMA_Stream_RX DMA1_Stream1
|
||||
#define AUX_SERIAL_DMA_Channel_RX DMA_Channel_4
|
||||
#define AUX_SERIAL_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_DMA1)
|
||||
#define AUX_SERIAL_RCC_APB1Periph RCC_APB1Periph_USART3
|
||||
#define AUX_SERIAL_GPIO GPIOB
|
||||
#define AUX_SERIAL_GPIO_PIN_TX GPIO_Pin_10 // PB.10
|
||||
#define AUX_SERIAL_GPIO_PIN_RX GPIO_Pin_11 // PB.11
|
||||
#define AUX_SERIAL_GPIO_PinSource_TX GPIO_PinSource10
|
||||
#define AUX_SERIAL_GPIO_PinSource_RX GPIO_PinSource11
|
||||
#define AUX_SERIAL_GPIO_AF GPIO_AF_USART3
|
||||
#define AUX_SERIAL_USART USART3
|
||||
#define AUX_SERIAL_USART_IRQHandler USART3_IRQHandler
|
||||
#define AUX_SERIAL_USART_IRQn USART3_IRQn
|
||||
#define AUX_SERIAL_DMA_Stream_RX DMA1_Stream1
|
||||
#define AUX_SERIAL_DMA_Channel_RX DMA_Channel_4
|
||||
#else
|
||||
#define AUX_SERIAL_RCC_AHB1Periph 0
|
||||
#define AUX_SERIAL_RCC_APB1Periph 0
|
||||
#define AUX_SERIAL_RCC_AHB1Periph 0
|
||||
#define AUX_SERIAL_RCC_APB1Periph 0
|
||||
#endif
|
||||
|
||||
// Telemetry
|
||||
@@ -385,8 +385,8 @@
|
||||
#define TELEMETRY_TIMER_IRQn TIM1_TRG_COM_TIM11_IRQn
|
||||
#define TELEMETRY_TIMER_IRQHandler TIM1_TRG_COM_TIM11_IRQHandler
|
||||
#if defined(PCBX12S)
|
||||
#define TELEMETRY_DMA_Stream_RX DMA1_Stream5
|
||||
#define TELEMETRY_DMA_Channel_RX DMA_Channel_4
|
||||
#define TELEMETRY_DMA_Stream_RX DMA1_Stream5
|
||||
#define TELEMETRY_DMA_Channel_RX DMA_Channel_4
|
||||
#endif
|
||||
#define TELEMETRY_DMA_Stream_TX DMA1_Stream6
|
||||
#define TELEMETRY_DMA_Channel_TX DMA_Channel_4
|
||||
@@ -547,7 +547,8 @@
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_T16)
|
||||
#define AUDIO_UNMUTE_DELAY 150
|
||||
#define AUDIO_UNMUTE_DELAY 120 // ms
|
||||
#define AUDIO_MUTE_DELAY 500 // ms
|
||||
#endif
|
||||
|
||||
// I2C Bus
|
||||
@@ -589,7 +590,7 @@
|
||||
#endif
|
||||
|
||||
#if !defined(RADIO_T16)
|
||||
#define EXTERNAL_ANTENNA
|
||||
#define EXTERNAL_ANTENNA
|
||||
#endif
|
||||
#define INTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_DMA2)
|
||||
#define INTMODULE_PWR_GPIO GPIOA
|
||||
@@ -615,6 +616,7 @@
|
||||
#define INTMODULE_BOOTCMD_GPIO GPIOI
|
||||
#define INTMODULE_BOOTCMD_GPIO_PIN GPIO_Pin_9 // PI.09
|
||||
#endif
|
||||
#define INIT_INTMODULE_BOOTCMD_PIN() GPIO_ResetBits(INTMODULE_BOOTCMD_GPIO, INTMODULE_BOOTCMD_GPIO_PIN);
|
||||
#if defined(PCBX10) || PCBREV >= 13
|
||||
#define INTMODULE_RCC_APB1Periph RCC_APB1Periph_TIM2
|
||||
#define INTMODULE_RCC_APB2Periph RCC_APB2Periph_USART1
|
||||
@@ -634,6 +636,7 @@
|
||||
// External Module
|
||||
#define EXTMODULE_PWR_GPIO GPIOB
|
||||
#define EXTMODULE_PWR_GPIO_PIN GPIO_Pin_3 // PB.03
|
||||
#define EXTERNAL_MODULE_PWR_OFF() GPIO_ResetBits(EXTMODULE_PWR_GPIO, EXTMODULE_PWR_GPIO_PIN)
|
||||
#if defined(PCBX10) && defined(PCBREV_EXPRESS)
|
||||
#define EXTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_DMA1)
|
||||
#define EXTMODULE_RCC_APB1Periph (RCC_APB1Periph_TIM2 | RCC_APB1Periph_USART3)
|
||||
@@ -714,9 +717,9 @@
|
||||
#define INTMODULE_HEARTBEAT_EXTI_IRQn EXTI15_10_IRQn
|
||||
#define INTMODULE_HEARTBEAT_REUSE_INTERRUPT_ROTARY_ENCODER
|
||||
#if defined(PXX2)
|
||||
#define INTMODULE_HEARTBEAT_TRIGGER EXTI_Trigger_Falling
|
||||
#define INTMODULE_HEARTBEAT_TRIGGER EXTI_Trigger_Falling
|
||||
#else
|
||||
#define INTMODULE_HEARTBEAT_TRIGGER EXTI_Trigger_Rising
|
||||
#define INTMODULE_HEARTBEAT_TRIGGER EXTI_Trigger_Rising
|
||||
#endif
|
||||
|
||||
// Trainer Port
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
/*
|
||||
* 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 "board.h"
|
||||
#include "storage/rtc_backup.h"
|
||||
|
||||
void pwrInit()
|
||||
{
|
||||
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;
|
||||
|
||||
// Internal module PWR
|
||||
GPIO_ResetBits(INTMODULE_PWR_GPIO, INTMODULE_PWR_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = INTMODULE_PWR_GPIO_PIN;
|
||||
GPIO_Init(INTMODULE_PWR_GPIO, &GPIO_InitStructure);
|
||||
|
||||
// External module PWR
|
||||
GPIO_ResetBits(EXTMODULE_PWR_GPIO, EXTMODULE_PWR_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = EXTMODULE_PWR_GPIO_PIN;
|
||||
GPIO_Init(EXTMODULE_PWR_GPIO, &GPIO_InitStructure);
|
||||
|
||||
#if defined(INTMODULE_BOOTCMD_GPIO)
|
||||
GPIO_ResetBits(INTMODULE_BOOTCMD_GPIO, INTMODULE_BOOTCMD_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = INTMODULE_BOOTCMD_GPIO_PIN;
|
||||
GPIO_Init(INTMODULE_BOOTCMD_GPIO, &GPIO_InitStructure);
|
||||
#endif
|
||||
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
|
||||
|
||||
// PWR SWITCH
|
||||
GPIO_InitStructure.GPIO_Pin = PWR_SWITCH_GPIO_PIN;
|
||||
GPIO_Init(PWR_SWITCH_GPIO, &GPIO_InitStructure);
|
||||
|
||||
// PCBREV
|
||||
#if defined(PCBREV_GPIO_PIN)
|
||||
GPIO_InitStructure.GPIO_Pin = PCBREV_GPIO_PIN;
|
||||
GPIO_Init(PCBREV_GPIO, &GPIO_InitStructure);
|
||||
hardwareOptions.pcbrev = PCBREV_VALUE();
|
||||
#endif
|
||||
|
||||
// SD-DETECT PIN
|
||||
GPIO_ResetBits(SD_PRESENT_GPIO, SD_PRESENT_GPIO_PIN);
|
||||
GPIO_InitStructure.GPIO_Pin = SD_PRESENT_GPIO_PIN;
|
||||
GPIO_Init(SD_PRESENT_GPIO, &GPIO_InitStructure);
|
||||
|
||||
// TRAINER DETECT PIN
|
||||
GPIO_InitStructure.GPIO_Pin = TRAINER_DETECT_GPIO_PIN;
|
||||
GPIO_Init(TRAINER_DETECT_GPIO, &GPIO_InitStructure);
|
||||
}
|
||||
|
||||
void pwrOn()
|
||||
{
|
||||
// we keep the init of the PIN to have pwrOn as quick as possible
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
void pwrOff()
|
||||
{
|
||||
GPIO_ResetBits(PWR_ON_GPIO, PWR_ON_GPIO_PIN);
|
||||
}
|
||||
|
||||
bool pwrPressed()
|
||||
{
|
||||
return GPIO_ReadInputDataBit(PWR_ON_GPIO, PWR_SWITCH_GPIO_PIN) == Bit_RESET;
|
||||
}
|
||||
|
||||
void pwrResetHandler()
|
||||
{
|
||||
RCC->AHB1ENR |= PWR_RCC_AHB1Periph;
|
||||
|
||||
// these two NOPs are needed (see STM32F errata sheet) before the peripheral
|
||||
// register can be written after the peripheral clock was enabled
|
||||
__ASM volatile ("nop");
|
||||
__ASM volatile ("nop");
|
||||
|
||||
if (WAS_RESET_BY_WATCHDOG_OR_SOFTWARE()) {
|
||||
pwrOn();
|
||||
}
|
||||
}
|
||||
@@ -159,7 +159,7 @@ void simuSetKey(uint8_t key, bool state)
|
||||
keysStates[key] = state;
|
||||
}
|
||||
|
||||
bool trimsStates[NUM_TRIMS * 2] = { false };
|
||||
bool trimsStates[NUM_TRIMS_KEYS] = { false };
|
||||
void simuSetTrim(uint8_t trim, bool state)
|
||||
{
|
||||
// TRACE("simuSetTrim(%d, %d)", trim, state);
|
||||
@@ -496,17 +496,17 @@ void pwrOff()
|
||||
void readKeysAndTrims()
|
||||
{
|
||||
uint8_t index = 0;
|
||||
uint32_t keys_input = readKeys();
|
||||
for (uint8_t i = 1; i != uint8_t(1 << TRM_BASE); i <<= 1) {
|
||||
keys[index++].input(keys_input & i);
|
||||
auto keysInput = readKeys();
|
||||
for (auto mask = (1 << 0); mask < (1 << TRM_BASE); mask <<= 1) {
|
||||
keys[index++].input(keysInput & mask);
|
||||
}
|
||||
|
||||
uint32_t trims_input = readTrims();
|
||||
for (uint8_t i = 1; i != uint8_t(1 << 8); i <<= 1) {
|
||||
keys[index++].input(trims_input & i);
|
||||
auto trimsInput = readTrims();
|
||||
for (auto mask = (1 << 0); mask < (1 << NUM_TRIMS_KEYS); mask <<= 1) {
|
||||
keys[index++].input(trimsInput & mask);
|
||||
}
|
||||
|
||||
if (keys_input || trims_input) {
|
||||
if (keysInput || trimsInput) {
|
||||
backlightOn();
|
||||
}
|
||||
}
|
||||
@@ -525,7 +525,7 @@ uint32_t readKeys()
|
||||
{
|
||||
uint32_t result = 0;
|
||||
|
||||
for (int i=0; i<NUM_KEYS; i++) {
|
||||
for (int i = 0; i < NUM_KEYS; i++) {
|
||||
if (keysStates[i]) {
|
||||
// TRACE("key pressed %d", i);
|
||||
result |= 1 << i;
|
||||
@@ -539,7 +539,7 @@ uint32_t readTrims()
|
||||
{
|
||||
uint32_t result = 0;
|
||||
|
||||
for (int i=0; i<NUM_TRIMS*2; i++) {
|
||||
for (int i=0; i<NUM_TRIMS_KEYS; i++) {
|
||||
if (trimsStates[i]) {
|
||||
// TRACE("trim pressed %d", i);
|
||||
result |= 1 << i;
|
||||
|
||||
@@ -214,6 +214,13 @@ void sdInit(void)
|
||||
f_lseek(&g_telemetryFile, f_size(&g_telemetryFile)); // append
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
f_open(&g_bluetoothFile, LOGS_PATH "/bluetooth.log", FA_OPEN_ALWAYS | FA_WRITE);
|
||||
if (f_size(&g_bluetoothFile) > 0) {
|
||||
f_lseek(&g_bluetoothFile, f_size(&g_bluetoothFile)); // append
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
TRACE_SIMPGMSPACE("f_mount() failed");
|
||||
@@ -226,6 +233,9 @@ void sdDone()
|
||||
audioQueue.stopSD();
|
||||
#if defined(LOG_TELEMETRY)
|
||||
f_close(&g_telemetryFile);
|
||||
#endif
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
f_close(&g_bluetoothFile);
|
||||
#endif
|
||||
f_mount(NULL, "", 0); // unmount SD
|
||||
}
|
||||
|
||||
@@ -162,6 +162,14 @@ elseif(PCB STREQUAL X7)
|
||||
set(BLUETOOTH YES)
|
||||
add_definitions(-DBLUETOOTH_PROBE)
|
||||
set(ROTARY_ENCODER YES)
|
||||
if(DEFINED PCBREV_HARDCODED)
|
||||
# This *can* be used to prevent messing with PA14 (SWCLK), so stlink can be used
|
||||
# without interruptions.
|
||||
if(NOT ${PCBREV_HARDCODED} MATCHES "^[0-1]$")
|
||||
message(FATAL_ERROR "PCBREV_HARDCODED must be 0 or 1, not '${PCBREV_HARDCODED}'")
|
||||
endif()
|
||||
add_definitions(-DPCBREV_HARDCODED=${PCBREV_HARDCODED})
|
||||
endif()
|
||||
endif()
|
||||
elseif(PCB STREQUAL X9LITE)
|
||||
option(INTERNAL_MODULE_PXX1 "Support for PXX1 internal module" OFF)
|
||||
@@ -201,7 +209,7 @@ elseif(PCB STREQUAL X9LITES)
|
||||
set(FLAVOUR x9lites)
|
||||
add_definitions(-DBOARD_NAME="x9lites")
|
||||
add_definitions(-DPCBX9LITES -DPCBX9LITE -DPCBX9 -DSOFTWARE_VOLUME -DHARDWARE_POWER_MANAGEMENT_UNIT)
|
||||
add_definitions(-DEEPROM_VARIANT=0x0800)
|
||||
add_definitions(-DEEPROM_VARIANT=0x0801)
|
||||
add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
|
||||
set(PXX2 ON)
|
||||
set(GUI_DIR 128x64)
|
||||
@@ -381,7 +389,7 @@ set(FIRMWARE_TARGET_SRC
|
||||
${LCD_DRIVER}
|
||||
board.cpp
|
||||
i2c_driver.cpp
|
||||
pwr_driver.cpp
|
||||
../common/arm/stm32/pwr_driver.cpp
|
||||
../common/arm/stm32/heartbeat_driver.cpp
|
||||
../common/arm/loadboot.cpp
|
||||
)
|
||||
|
||||
@@ -116,7 +116,7 @@ void boardInit()
|
||||
BT_RCC_APB2Periph,
|
||||
ENABLE);
|
||||
|
||||
#if defined(BLUETOOTH)
|
||||
#if defined(BLUETOOTH) && !defined(PCBX9E)
|
||||
bluetoothInit(BLUETOOTH_DEFAULT_BAUDRATE, true);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -61,6 +61,13 @@ void boardOff();
|
||||
void init2MhzTimer();
|
||||
void init5msTimer();
|
||||
|
||||
// PCBREV driver
|
||||
enum {
|
||||
// X7
|
||||
PCBREV_X7_STD = 0,
|
||||
PCBREV_X7_40 = 1,
|
||||
};
|
||||
|
||||
// SD driver
|
||||
#define BLOCK_SIZE 512 /* Block Size in Bytes */
|
||||
#if !defined(SIMU) || defined(SIMU_DISKIO)
|
||||
@@ -529,28 +536,27 @@ enum Analogs {
|
||||
#define NUM_MOUSE_ANALOGS 0
|
||||
#define STORAGE_NUM_MOUSE_ANALOGS 0
|
||||
|
||||
#if defined(PCBXLITE)
|
||||
#define NUM_TRIMS_KEYS 4
|
||||
#else
|
||||
#define NUM_TRIMS_KEYS (NUM_TRIMS * 2)
|
||||
#endif
|
||||
|
||||
#if defined(STICKS_PWM)
|
||||
#define NUM_PWMSTICKS 4
|
||||
#define STICKS_PWM_ENABLED() (!hardwareOptions.sticksPwmDisabled)
|
||||
void sticksPwmInit();
|
||||
void sticksPwmRead(uint16_t * values);
|
||||
extern volatile uint32_t pwm_interrupt_count; // TODO => reusable buffer (boot section)
|
||||
#define NUM_TRIMS_KEYS 4
|
||||
#else
|
||||
#define NUM_TRIMS_KEYS 8
|
||||
#define STICKS_PWM_ENABLED() false
|
||||
#endif
|
||||
|
||||
#if NUM_PWMSTICKS > 0
|
||||
PACK(typedef struct {
|
||||
uint8_t pcbrev:2;
|
||||
uint8_t sticksPwmDisabled:1;
|
||||
uint8_t pxx2Enabled:1;
|
||||
}) HardwareOptions;
|
||||
#else
|
||||
PACK(typedef struct {
|
||||
uint8_t pxx2Enabled:1;
|
||||
}) HardwareOptions;
|
||||
#endif
|
||||
|
||||
extern HardwareOptions hardwareOptions;
|
||||
|
||||
@@ -701,7 +707,7 @@ void telemetryPortInvertedInit(uint32_t baudrate);
|
||||
#if defined(PCBX7ACCESS)
|
||||
#define HAS_SPORT_UPDATE_CONNECTOR() true
|
||||
#elif defined(PCBX7)
|
||||
#define IS_PCBREV_40() (GPIO_ReadInputDataBit(PCBREV_GPIO, PCBREV_GPIO_PIN) == Bit_SET)
|
||||
#define IS_PCBREV_40() (hardwareOptions.pcbrev == PCBREV_X7_40)
|
||||
#define HAS_SPORT_UPDATE_CONNECTOR() IS_PCBREV_40()
|
||||
#elif defined(SPORT_UPDATE_PWR_GPIO)
|
||||
#define HAS_SPORT_UPDATE_CONNECTOR() true
|
||||
|
||||
@@ -978,10 +978,15 @@ void sdPoll10ms()
|
||||
// TODO everything here should not be in the driver layer ...
|
||||
|
||||
FATFS g_FATFS_Obj;
|
||||
|
||||
#if defined(LOG_TELEMETRY)
|
||||
FIL g_telemetryFile = {};
|
||||
#endif
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
FIL g_bluetoothFile = {};
|
||||
#endif
|
||||
|
||||
#if defined(BOOT)
|
||||
void sdInit(void)
|
||||
{
|
||||
@@ -1016,6 +1021,13 @@ void sdMount()
|
||||
f_lseek(&g_telemetryFile, f_size(&g_telemetryFile)); // append
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
f_open(&g_bluetoothFile, LOGS_PATH "/bluetooth.log", FA_OPEN_ALWAYS | FA_WRITE);
|
||||
if (f_size(&g_bluetoothFile) > 0) {
|
||||
f_lseek(&g_bluetoothFile, f_size(&g_bluetoothFile)); // append
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1025,6 +1037,9 @@ void sdDone()
|
||||
audioQueue.stopSD();
|
||||
#if defined(LOG_TELEMETRY)
|
||||
f_close(&g_telemetryFile);
|
||||
#endif
|
||||
#if defined(LOG_BLUETOOTH)
|
||||
f_close(&g_bluetoothFile);
|
||||
#endif
|
||||
f_mount(nullptr, "", 0); // unmount SD
|
||||
}
|
||||
|
||||
@@ -986,23 +986,24 @@
|
||||
#define INTMODULE_PWR_GPIO GPIOD
|
||||
#define INTMODULE_PWR_GPIO_PIN GPIO_Pin_9 // PD.09
|
||||
#endif
|
||||
#define INTMODULE_GPIO GPIOB
|
||||
#define INTMODULE_TX_GPIO_PIN GPIO_Pin_6 // PB.06
|
||||
#define INTMODULE_RX_GPIO_PIN GPIO_Pin_7 // PB.07
|
||||
#define INTMODULE_GPIO_PinSource_TX GPIO_PinSource6
|
||||
#define INTMODULE_GPIO_PinSource_RX GPIO_PinSource7
|
||||
#define INTMODULE_USART USART1
|
||||
#define INTMODULE_GPIO_AF GPIO_AF_USART1
|
||||
#define INTMODULE_USART_IRQHandler USART1_IRQHandler
|
||||
#define INTMODULE_USART_IRQn USART1_IRQn
|
||||
#define INTMODULE_DMA_STREAM DMA2_Stream7
|
||||
#define INTMODULE_GPIO GPIOB
|
||||
#define INTMODULE_TX_GPIO_PIN GPIO_Pin_6 // PB.06
|
||||
#define INTMODULE_RX_GPIO_PIN GPIO_Pin_7 // PB.07
|
||||
#define INTMODULE_GPIO_PinSource_TX GPIO_PinSource6
|
||||
#define INTMODULE_GPIO_PinSource_RX GPIO_PinSource7
|
||||
#define INTMODULE_USART USART1
|
||||
#define INTMODULE_GPIO_AF GPIO_AF_USART1
|
||||
#define INTMODULE_USART_IRQHandler USART1_IRQHandler
|
||||
#define INTMODULE_USART_IRQn USART1_IRQn
|
||||
#define INTMODULE_DMA_STREAM DMA2_Stream7
|
||||
#define INTMODULE_DMA_STREAM_IRQ DMA2_Stream7_IRQn
|
||||
#define INTMODULE_DMA_STREAM_IRQHandler DMA2_Stream7_IRQHandler
|
||||
#define INTMODULE_DMA_FLAG_TC DMA_IT_TCIF7
|
||||
#define INTMODULE_DMA_CHANNEL DMA_Channel_4
|
||||
#define INTMODULE_DMA_FLAG_TC DMA_IT_TCIF7
|
||||
#define INTMODULE_DMA_CHANNEL DMA_Channel_4
|
||||
#if defined(PCBXLITES)
|
||||
#define INTMODULE_BOOTCMD_GPIO GPIOC
|
||||
#define INTMODULE_BOOTCMD_GPIO_PIN GPIO_Pin_8 // PC.08
|
||||
#define INTMODULE_BOOTCMD_GPIO GPIOC
|
||||
#define INTMODULE_BOOTCMD_GPIO_PIN GPIO_Pin_8 // PC.08
|
||||
#define INIT_INTMODULE_BOOTCMD_PIN() GPIO_SetBits(INTMODULE_BOOTCMD_GPIO, INTMODULE_BOOTCMD_GPIO_PIN);
|
||||
#endif
|
||||
#elif defined(RADIO_X9DP2019)
|
||||
#define INTMODULE_RCC_APB1Periph 0
|
||||
@@ -1374,6 +1375,7 @@
|
||||
#define PCBREV_RCC_AHB1Periph RCC_AHB1Periph_GPIOA
|
||||
#define PCBREV_GPIO GPIOA
|
||||
#define PCBREV_GPIO_PIN GPIO_Pin_14 // PA.14
|
||||
#define PCBREV_VALUE() GPIO_ReadInputDataBit(PCBREV_GPIO, PCBREV_GPIO_PIN)
|
||||
#else
|
||||
#define PCBREV_RCC_AHB1Periph 0
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user