indirect frequency measurement
This commit is contained in:
@@ -61,6 +61,7 @@ static struct callbacks_ {
|
||||
struct cbslot dma2_7;
|
||||
struct cbslot dma2_8;
|
||||
|
||||
struct cbslot tim2;
|
||||
struct cbslot tim6;
|
||||
struct cbslot tim7;
|
||||
struct cbslot tim15;
|
||||
@@ -102,7 +103,7 @@ void irqd_init(void)
|
||||
HAL_NVIC_SetPriority(ADC1_COMP_IRQn, 1, 0); // ADC group completion - higher prio than DMA to let it handle the last halfword first
|
||||
|
||||
// NVIC_EnableIRQ(TIM1_IRQn); /*!< TIM1 global Interrupt */
|
||||
// NVIC_EnableIRQ(TIM2_IRQn); /*!< TIM2 global Interrupt */
|
||||
NVIC_EnableIRQ(TIM2_IRQn); /*!< TIM2 global Interrupt */
|
||||
// NVIC_EnableIRQ(TIM3_IRQn); /*!< TIM3 global Interrupt */
|
||||
|
||||
NVIC_EnableIRQ(TIM6_DAC_IRQn); /*!< TIM6 global and DAC channel underrun error Interrupt */
|
||||
@@ -159,6 +160,7 @@ static struct cbslot *get_slot_for_periph(void *periph)
|
||||
else if (periph == USART5) slot = &callbacks.usart5;
|
||||
#endif
|
||||
|
||||
else if (periph == TIM2) slot = &callbacks.tim2;
|
||||
else if (periph == TIM6) slot = &callbacks.tim6;
|
||||
else if (periph == TIM7) slot = &callbacks.tim7;
|
||||
else if (periph == TIM15) slot = &callbacks.tim15;
|
||||
@@ -304,6 +306,11 @@ void EXTI4_15_IRQHandler(void)
|
||||
|
||||
// TIM14 is used to generate HAL timebase and its handler is in the file "timebase.c"
|
||||
|
||||
void TIM2_IRQHandler(void)
|
||||
{
|
||||
CALL_IRQ_HANDLER(callbacks.tim2);
|
||||
}
|
||||
|
||||
void TIM6_DAC_IRQHandler(void)
|
||||
{
|
||||
CALL_IRQ_HANDLER(callbacks.tim6);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// Created by MightyPork on 2017/11/26.
|
||||
//
|
||||
|
||||
#include <units/fcap/unit_fcap.h>
|
||||
#include "platform.h"
|
||||
#include "usbd_core.h"
|
||||
#include "USB/usb_device.h"
|
||||
@@ -88,6 +89,7 @@ void plat_init_resources(void)
|
||||
ureg_add_type(&UNIT_1WIRE);
|
||||
ureg_add_type(&UNIT_ADC);
|
||||
ureg_add_type(&UNIT_SIPO);
|
||||
ureg_add_type(&UNIT_FCAP);
|
||||
|
||||
// Free all present resources
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user