good decode sos, 2 remote controllers
This commit is contained in:
parent
c54733fdf7
commit
71d28cf536
|
@ -137,16 +137,42 @@ int main(void)
|
||||||
|
|
||||||
// MX_USART1_UART_Init();
|
// MX_USART1_UART_Init();
|
||||||
|
|
||||||
//MX_TIM1_Init();
|
MX_TIM1_Init();
|
||||||
MX_TIM2_Init();
|
MX_TIM2_Init();
|
||||||
|
|
||||||
/*## Start the TIM Base generation in interrupt mode ####################*/
|
/*## Start the TIM Base generation in interrupt mode ####################*/
|
||||||
/* Start Channel1 */
|
/* Start Channel1 */
|
||||||
|
if (HAL_TIM_Base_Start_IT(&htim1) != HAL_OK)
|
||||||
|
{
|
||||||
|
/* Starting Error */
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (HAL_TIM_Base_Start_IT(&htim2) != HAL_OK)
|
if (HAL_TIM_Base_Start_IT(&htim2) != HAL_OK)
|
||||||
{
|
{
|
||||||
/* Starting Error */
|
/* Starting Error */
|
||||||
Error_Handler();
|
Error_Handler();
|
||||||
}
|
}
|
||||||
|
/* --------------------------------------------------------------------------- */
|
||||||
|
#if 1
|
||||||
|
/*## Start the Input Capture in interrupt mode ##########################*/
|
||||||
|
if (HAL_TIM_IC_Start_IT(&htim1, TIM_CHANNEL_2) != HAL_OK)
|
||||||
|
{
|
||||||
|
/* Starting Error */
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
/*## Start the Input Capture in interrupt mode ##########################*/
|
||||||
|
if (HAL_TIM_IC_Start_IT(&htim1, TIM_CHANNEL_1) != HAL_OK)
|
||||||
|
{
|
||||||
|
/* Starting Error */
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
printf("start \r\n");
|
printf("start \r\n");
|
||||||
|
|
|
@ -192,6 +192,7 @@ void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
|
||||||
/* USER CODE END TIM2_MspDeInit 1 */
|
/* USER CODE END TIM2_MspDeInit 1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/* USER CODE BEGIN 1 */
|
/* USER CODE BEGIN 1 */
|
||||||
|
|
||||||
|
|
|
@ -459,13 +459,14 @@ void SUBGHZ_Radio_IRQHandler(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* USER CODE BEGIN 1 */
|
/* USER CODE BEGIN 1 */
|
||||||
#if 1
|
#if 0
|
||||||
void TIM1_IRQHandler(void)
|
void TIM1_IRQHandler(void)
|
||||||
{
|
{
|
||||||
HAL_TIM_IRQHandler(&htim1);
|
HAL_TIM_IRQHandler(&htim1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if 1
|
|
||||||
|
#if 0
|
||||||
/**
|
/**
|
||||||
* @brief This function handles TIM1 Capture Compare Interrupt.
|
* @brief This function handles TIM1 Capture Compare Interrupt.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -89,7 +89,7 @@ void MX_TIM1_Init(void)
|
||||||
htim1.Instance = TIM1;
|
htim1.Instance = TIM1;
|
||||||
htim1.Init.Prescaler = TIM1_PRESCALER_VALUE;
|
htim1.Init.Prescaler = TIM1_PRESCALER_VALUE;
|
||||||
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||||
htim1.Init.Period = TIM1_PERIOD_VALUE; // TIM1_PERIOD_VALUE; // 0xffff; // TIM1_PERIOD_VALUE;
|
htim1.Init.Period = 9*TIM1_PERIOD_VALUE; // TIM1_PERIOD_VALUE; // 0xffff; // TIM1_PERIOD_VALUE;
|
||||||
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||||
htim1.Init.RepetitionCounter = 0;
|
htim1.Init.RepetitionCounter = 0;
|
||||||
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
htim1.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||||
|
@ -257,8 +257,13 @@ void EV1527Decode(uint32_t v)
|
||||||
|
|
||||||
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
|
||||||
{
|
{
|
||||||
//printf(".");
|
if (TIM1 == htim->Instance)
|
||||||
RF_Signal_Decode();
|
{
|
||||||
|
printf(".");
|
||||||
|
} else if (TIM2 == htim->Instance)
|
||||||
|
{
|
||||||
|
RF_Signal_Decode();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,7 +275,7 @@ void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim)
|
||||||
static uint32_t highCnt=0, lowCnt=0;
|
static uint32_t highCnt=0, lowCnt=0;
|
||||||
static uint8_t sync=0;
|
static uint8_t sync=0;
|
||||||
|
|
||||||
//printf(" cc ");
|
printf(" cc ");
|
||||||
// RF_Signal_Decode();
|
// RF_Signal_Decode();
|
||||||
|
|
||||||
if (TIM1 == htim->Instance)
|
if (TIM1 == htim->Instance)
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue