Finally removed StdPeriph EXTI driver
This commit is contained in:
committed by
Raphael Coeffic
parent
5219dd606d
commit
4b2c30db3c
@@ -84,9 +84,6 @@ endif()
|
|||||||
|
|
||||||
set(FIRMWARE_SRC ${FIRMWARE_SRC} syscalls.c)
|
set(FIRMWARE_SRC ${FIRMWARE_SRC} syscalls.c)
|
||||||
|
|
||||||
foreach(FILE ${STM32LIB_SRC})
|
|
||||||
set(FIRMWARE_SRC ${FIRMWARE_SRC} ${STM32LIB_DIR}/${FILE})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
foreach(FILE ${STM32USB_SRC})
|
foreach(FILE ${STM32USB_SRC})
|
||||||
set(FIRMWARE_SRC ${FIRMWARE_SRC} ${STM32USB_DIR}/${FILE})
|
set(FIRMWARE_SRC ${FIRMWARE_SRC} ${STM32USB_DIR}/${FILE})
|
||||||
|
|||||||
@@ -1,54 +1,16 @@
|
|||||||
# TODO if the files order is different (these 2 SRC sections exchanged), the bootloader hangs for 20s in USB init. Why?
|
|
||||||
|
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
if(CPU_TYPE_FULL STREQUAL STM32F429xI)
|
if(CPU_TYPE_FULL STREQUAL STM32F429xI)
|
||||||
set(BOOTLOADER_SRC
|
set(BOOTLOADER_SRC ${BOOTLOADER_SRC}
|
||||||
${BOOTLOADER_SRC}
|
|
||||||
../f4/system_stm32f4xx.c
|
|
||||||
../../../../../targets/${TARGET_DIR}/startup_stm32f42_43xxx.s
|
../../../../../targets/${TARGET_DIR}/startup_stm32f42_43xxx.s
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rtc.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_syscfg.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_exti.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_fmc.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_ltdc.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma2d.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_sdio.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/misc.c
|
|
||||||
)
|
)
|
||||||
elseif(CPU_TYPE_FULL STREQUAL STM32F407xE)
|
elseif(CPU_TYPE_FULL STREQUAL STM32F407xE)
|
||||||
set(BOOTLOADER_SRC
|
set(BOOTLOADER_SRC ${BOOTLOADER_SRC}
|
||||||
${BOOTLOADER_SRC}
|
|
||||||
../f4/system_stm32f4xx.c
|
|
||||||
../../../../../targets/${TARGET_DIR}/startup_stm32f40_41xxx.s
|
../../../../../targets/${TARGET_DIR}/startup_stm32f40_41xxx.s
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rtc.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_syscfg.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_exti.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_i2c.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver/src/misc.c
|
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
set(BOOTLOADER_SRC
|
# startup file is already included from CMSIS in F2 CMakeLists.txt
|
||||||
${BOOTLOADER_SRC}
|
|
||||||
../f2/system_stm32f2xx.c
|
|
||||||
../../../../../${STM32LIB_DIR}/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_syscfg.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_exti.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_i2c.c
|
|
||||||
../../../../../${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/src/misc.c
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(BOOTLOADER_SRC
|
set(BOOTLOADER_SRC
|
||||||
|
|||||||
@@ -37,23 +37,26 @@ include_directories(${STM32LIB_DIR}/CMSIS/Include)
|
|||||||
|
|
||||||
add_definitions(-DSTM32F2)
|
add_definitions(-DSTM32F2)
|
||||||
|
|
||||||
set(STM32LIB_SRC
|
set(STM32_STDPERIPH_DIR ${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver)
|
||||||
${STM32LIB_SRC}
|
|
||||||
CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s
|
add_library(stm32_stdperiph OBJECT EXCLUDE_FROM_ALL
|
||||||
STM32F2xx_StdPeriph_Driver/src/misc.c
|
${STM32LIB_DIR}/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c
|
${STM32_STDPERIPH_DIR}/src/misc.c
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_exti.c
|
${STM32_STDPERIPH_DIR}/src/stm32f2xx_gpio.c
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dbgmcu.c
|
${STM32_STDPERIPH_DIR}/src/stm32f2xx_dbgmcu.c
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c
|
${STM32_STDPERIPH_DIR}/src/stm32f2xx_rcc.c
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_syscfg.c
|
${STM32_STDPERIPH_DIR}/src/stm32f2xx_syscfg.c
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c
|
${STM32_STDPERIPH_DIR}/src/stm32f2xx_spi.c
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dma.c
|
${STM32_STDPERIPH_DIR}/src/stm32f2xx_dma.c
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rtc.c
|
${STM32_STDPERIPH_DIR}/src/stm32f2xx_rtc.c
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_pwr.c
|
${STM32_STDPERIPH_DIR}/src/stm32f2xx_pwr.c
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_usart.c
|
${STM32_STDPERIPH_DIR}/src/stm32f2xx_usart.c
|
||||||
STM32F2xx_StdPeriph_Driver/src/stm32f2xx_adc.c
|
${STM32_STDPERIPH_DIR}/src/stm32f2xx_adc.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(FIRMWARE_SRC ${FIRMWARE_SRC} $<TARGET_OBJECTS:stm32_stdperiph>)
|
||||||
|
set(BOOTLOADER_SRC ${BOOTLOADER_SRC} $<TARGET_OBJECTS:stm32_stdperiph>)
|
||||||
|
|
||||||
if(NOT NATIVE_BUILD)
|
if(NOT NATIVE_BUILD)
|
||||||
#
|
#
|
||||||
# FreeRTOS port specific include
|
# FreeRTOS port specific include
|
||||||
|
|||||||
@@ -37,22 +37,31 @@ include_directories(${STM32LIB_DIR}/CMSIS/Include)
|
|||||||
|
|
||||||
add_definitions(-DSTM32F4)
|
add_definitions(-DSTM32F4)
|
||||||
|
|
||||||
set(STM32LIB_SRC
|
set(STM32_STDPERIPH_DIR ${STM32LIB_DIR}/STM32F4xx_StdPeriph_Driver)
|
||||||
${STM32LIB_SRC}
|
|
||||||
STM32F4xx_StdPeriph_Driver/src/misc.c
|
add_library(stm32_stdperiph OBJECT EXCLUDE_FROM_ALL
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_gpio.c
|
targets/common/arm/stm32/f4/system_stm32f4xx.c
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_exti.c
|
${STM32_STDPERIPH_DIR}/src/misc.c
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dbgmcu.c
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_gpio.c
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rcc.c
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_dbgmcu.c
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_syscfg.c
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_rcc.c
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_spi.c
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_syscfg.c
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_dma.c
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_spi.c
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_rtc.c
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_dma.c
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_rtc.c
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_usart.c
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_pwr.c
|
||||||
STM32F4xx_StdPeriph_Driver/src/stm32f4xx_adc.c
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_usart.c
|
||||||
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_adc.c
|
||||||
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_fmc.c
|
||||||
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_ltdc.c
|
||||||
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_dma.c
|
||||||
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_dma2d.c
|
||||||
|
${STM32_STDPERIPH_DIR}/src/stm32f4xx_sdio.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(FIRMWARE_SRC ${FIRMWARE_SRC} $<TARGET_OBJECTS:stm32_stdperiph>)
|
||||||
|
set(BOOTLOADER_SRC ${BOOTLOADER_SRC} $<TARGET_OBJECTS:stm32_stdperiph>)
|
||||||
|
|
||||||
if(NOT NATIVE_BUILD)
|
if(NOT NATIVE_BUILD)
|
||||||
#
|
#
|
||||||
# FreeRTOS port specific include
|
# FreeRTOS port specific include
|
||||||
@@ -80,8 +89,5 @@ if(NOT NATIVE_BUILD)
|
|||||||
#
|
#
|
||||||
# System and FreeRTOS port files
|
# System and FreeRTOS port files
|
||||||
#
|
#
|
||||||
set(FIRMWARE_SRC ${FIRMWARE_SRC}
|
set(FIRMWARE_SRC ${FIRMWARE_SRC} $<TARGET_OBJECTS:freertos>)
|
||||||
$<TARGET_OBJECTS:freertos>
|
|
||||||
targets/common/arm/stm32/f4/system_stm32f4xx.c
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -499,15 +499,6 @@
|
|||||||
#define TELEMETRY_GPIO_PinSource_RX GPIO_PinSource6
|
#define TELEMETRY_GPIO_PinSource_RX GPIO_PinSource6
|
||||||
#define TELEMETRY_GPIO_AF GPIO_AF_USART2
|
#define TELEMETRY_GPIO_AF GPIO_AF_USART2
|
||||||
#define TELEMETRY_USART USART2
|
#define TELEMETRY_USART USART2
|
||||||
#define TELEMETRY_EXTI_PortSource EXTI_PortSourceGPIOD
|
|
||||||
#define TELEMETRY_EXTI_PinSource EXTI_PinSource6
|
|
||||||
#define TELEMETRY_EXTI_LINE EXTI_Line6
|
|
||||||
#define TELEMETRY_EXTI_IRQn EXTI9_5_IRQn
|
|
||||||
#define TELEMETRY_EXTI_IRQHandler EXTI9_5_IRQHandler
|
|
||||||
#define TELEMETRY_EXTI_TRIGGER EXTI_Trigger_Rising
|
|
||||||
#define TELEMETRY_TIMER TIM11
|
|
||||||
#define TELEMETRY_TIMER_IRQn TIM1_TRG_COM_TIM11_IRQn
|
|
||||||
#define TELEMETRY_TIMER_IRQHandler TIM1_TRG_COM_TIM11_IRQHandler
|
|
||||||
#if defined(PCBX12S)
|
#if defined(PCBX12S)
|
||||||
#define TELEMETRY_DMA_Stream_RX DMA1_Stream5
|
#define TELEMETRY_DMA_Stream_RX DMA1_Stream5
|
||||||
#define TELEMETRY_DMA_Channel_RX DMA_Channel_4
|
#define TELEMETRY_DMA_Channel_RX DMA_Channel_4
|
||||||
@@ -519,6 +510,19 @@
|
|||||||
#define TELEMETRY_DMA_TX_FLAG_TC DMA_IT_TCIF6
|
#define TELEMETRY_DMA_TX_FLAG_TC DMA_IT_TCIF6
|
||||||
#define TELEMETRY_USART_IRQHandler USART2_IRQHandler
|
#define TELEMETRY_USART_IRQHandler USART2_IRQHandler
|
||||||
#define TELEMETRY_USART_IRQn USART2_IRQn
|
#define TELEMETRY_USART_IRQn USART2_IRQn
|
||||||
|
#define TELEMETRY_EXTI_PORT LL_SYSCFG_EXTI_PORTD
|
||||||
|
#define TELEMETRY_EXTI_SYS_LINE LL_SYSCFG_EXTI_LINE6
|
||||||
|
#define TELEMETRY_EXTI_LINE LL_EXTI_LINE_6
|
||||||
|
#define TELEMETRY_EXTI_TRIGGER LL_EXTI_TRIGGER_RISING
|
||||||
|
// TELEMETRY_EXTI IRQ
|
||||||
|
#if !defined(USE_EXTI9_5_IRQ)
|
||||||
|
#define USE_EXTI9_5_IRQ
|
||||||
|
#define EXTI9_5_IRQ_Priority 5
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define TELEMETRY_TIMER TIM11
|
||||||
|
#define TELEMETRY_TIMER_IRQn TIM1_TRG_COM_TIM11_IRQn
|
||||||
|
#define TELEMETRY_TIMER_IRQHandler TIM1_TRG_COM_TIM11_IRQHandler
|
||||||
|
|
||||||
// USB
|
// USB
|
||||||
#define USB_RCC_AHB1Periph_GPIO RCC_AHB1Periph_GPIOA
|
#define USB_RCC_AHB1Periph_GPIO RCC_AHB1Periph_GPIOA
|
||||||
|
|||||||
@@ -19,10 +19,12 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "stm32_hal_ll.h"
|
||||||
|
#include "stm32_exti_driver.h"
|
||||||
|
#include "aux_serial_driver.h"
|
||||||
|
|
||||||
#include "opentx.h"
|
#include "opentx.h"
|
||||||
|
|
||||||
#include "fifo.h"
|
|
||||||
#include "dmafifo.h"
|
|
||||||
|
|
||||||
#if defined(GHOST)
|
#if defined(GHOST)
|
||||||
#include "telemetry/ghost.h"
|
#include "telemetry/ghost.h"
|
||||||
@@ -157,19 +159,24 @@ static uint8_t rxByte;
|
|||||||
static uint16_t bitLength;
|
static uint16_t bitLength;
|
||||||
static uint16_t probeTimeFromStartBit;
|
static uint16_t probeTimeFromStartBit;
|
||||||
|
|
||||||
|
static void do_telemetry_exti()
|
||||||
|
{
|
||||||
|
if (rxBitCount == 0) {
|
||||||
|
|
||||||
|
TELEMETRY_TIMER->ARR = probeTimeFromStartBit; // 1,5 cycle from start at 57600bps
|
||||||
|
TELEMETRY_TIMER->CR1 |= TIM_CR1_CEN;
|
||||||
|
|
||||||
|
// disable start bit interrupt
|
||||||
|
EXTI->IMR &= ~EXTI_IMR_MR6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void telemetryPortInvertedInit(uint32_t baudrate)
|
void telemetryPortInvertedInit(uint32_t baudrate)
|
||||||
{
|
{
|
||||||
if (baudrate == 0) {
|
if (baudrate == 0) {
|
||||||
NVIC_DisableIRQ(TELEMETRY_EXTI_IRQn);
|
|
||||||
NVIC_DisableIRQ(TELEMETRY_TIMER_IRQn);
|
|
||||||
|
|
||||||
EXTI_InitTypeDef EXTI_InitStructure;
|
stm32_exti_disable(TELEMETRY_EXTI_LINE);
|
||||||
EXTI_StructInit(&EXTI_InitStructure);
|
NVIC_DisableIRQ(TELEMETRY_TIMER_IRQn);
|
||||||
EXTI_InitStructure.EXTI_Line = TELEMETRY_EXTI_LINE;
|
|
||||||
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
|
|
||||||
EXTI_InitStructure.EXTI_Trigger = TELEMETRY_EXTI_TRIGGER;
|
|
||||||
EXTI_InitStructure.EXTI_LineCmd = DISABLE;
|
|
||||||
EXTI_Init(&EXTI_InitStructure);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,19 +222,10 @@ void telemetryPortInvertedInit(uint32_t baudrate)
|
|||||||
telemetryInitDirPin();
|
telemetryInitDirPin();
|
||||||
|
|
||||||
// Connect EXTI line to TELEMETRY RX pin
|
// Connect EXTI line to TELEMETRY RX pin
|
||||||
SYSCFG_EXTILineConfig(TELEMETRY_EXTI_PortSource, TELEMETRY_EXTI_PinSource);
|
LL_SYSCFG_SetEXTISource(TELEMETRY_EXTI_PORT, TELEMETRY_EXTI_SYS_LINE);
|
||||||
|
|
||||||
// Configure EXTI for raising edge (start bit)
|
// Configure EXTI for raising edge (start bit)
|
||||||
EXTI_InitTypeDef EXTI_InitStructure;
|
stm32_exti_enable(TELEMETRY_EXTI_LINE, TELEMETRY_EXTI_TRIGGER, do_telemetry_exti);
|
||||||
EXTI_StructInit(&EXTI_InitStructure);
|
|
||||||
EXTI_InitStructure.EXTI_Line = TELEMETRY_EXTI_LINE;
|
|
||||||
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
|
|
||||||
EXTI_InitStructure.EXTI_Trigger = TELEMETRY_EXTI_TRIGGER;
|
|
||||||
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
|
|
||||||
EXTI_Init(&EXTI_InitStructure);
|
|
||||||
|
|
||||||
NVIC_SetPriority(TELEMETRY_EXTI_IRQn, 0);
|
|
||||||
NVIC_EnableIRQ(TELEMETRY_EXTI_IRQn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void telemetryPortInvertedRxBit()
|
void telemetryPortInvertedRxBit()
|
||||||
@@ -265,7 +263,7 @@ void telemetryPortSetDirectionOutput()
|
|||||||
TELEMETRY_USART->BRR = BRR_400K;
|
TELEMETRY_USART->BRR = BRR_400K;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
TELEMETRY_DIR_GPIO->BSRRL = TELEMETRY_DIR_GPIO_PIN; // output enable
|
GPIO_SetBits(TELEMETRY_DIR_GPIO, TELEMETRY_DIR_GPIO_PIN);
|
||||||
TELEMETRY_USART->CR1 &= ~USART_CR1_RE; // turn off receiver
|
TELEMETRY_USART->CR1 &= ~USART_CR1_RE; // turn off receiver
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,7 +280,7 @@ void telemetryPortSetDirectionInput()
|
|||||||
TELEMETRY_USART->BRR = BRR_115K;
|
TELEMETRY_USART->BRR = BRR_115K;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
TELEMETRY_DIR_GPIO->BSRRH = TELEMETRY_DIR_GPIO_PIN; // output disable
|
GPIO_ResetBits(TELEMETRY_DIR_GPIO, TELEMETRY_DIR_GPIO_PIN);
|
||||||
TELEMETRY_USART->CR1 |= USART_CR1_RE; // turn on receiver
|
TELEMETRY_USART->CR1 |= USART_CR1_RE; // turn on receiver
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,23 +403,6 @@ extern "C" void TELEMETRY_USART_IRQHandler(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void TELEMETRY_EXTI_IRQHandler(void)
|
|
||||||
{
|
|
||||||
if (EXTI_GetITStatus(TELEMETRY_EXTI_LINE) != RESET) {
|
|
||||||
|
|
||||||
if (rxBitCount == 0) {
|
|
||||||
|
|
||||||
TELEMETRY_TIMER->ARR = probeTimeFromStartBit; // 1,5 cycle from start at 57600bps
|
|
||||||
TELEMETRY_TIMER->CR1 |= TIM_CR1_CEN;
|
|
||||||
|
|
||||||
// disable start bit interrupt
|
|
||||||
EXTI->IMR &= ~EXTI_IMR_MR6;
|
|
||||||
}
|
|
||||||
|
|
||||||
EXTI_ClearITPendingBit(TELEMETRY_EXTI_LINE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" void TELEMETRY_TIMER_IRQHandler()
|
extern "C" void TELEMETRY_TIMER_IRQHandler()
|
||||||
{
|
{
|
||||||
TELEMETRY_TIMER->SR &= ~TIM_SR_UIF;
|
TELEMETRY_TIMER->SR &= ~TIM_SR_UIF;
|
||||||
|
|||||||
Reference in New Issue
Block a user