mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #961 from openmv/dcmi_irqs
Move DCMI IRQ handlers to sensor.c
This commit is contained in:
commit
86142a1f09
@ -1 +1 @@
|
||||
Subproject commit bea4a37fcc82eb2be64ed2cde61866faba50e8c4
|
||||
Subproject commit b7ddc1124da6ac0ce392982ada821c9cd8d54ffc
|
||||
@ -30,10 +30,10 @@
|
||||
|
||||
extern void __fatal_error(const char *msg);
|
||||
|
||||
sensor_t sensor = {0};
|
||||
TIM_HandleTypeDef TIMHandle = {0};
|
||||
DMA_HandleTypeDef DMAHandle = {0};
|
||||
DCMI_HandleTypeDef DCMIHandle = {0};
|
||||
sensor_t sensor = {0};
|
||||
static TIM_HandleTypeDef TIMHandle = {0};
|
||||
static DMA_HandleTypeDef DMAHandle = {0};
|
||||
static DCMI_HandleTypeDef DCMIHandle = {0};
|
||||
|
||||
extern uint8_t _line_buf;
|
||||
static uint8_t *dest_fb = NULL;
|
||||
@ -81,6 +81,14 @@ const int resolution[][2] = {
|
||||
{2592, 1944}, /* WQXGA2 */
|
||||
};
|
||||
|
||||
void DCMI_IRQHandler(void) {
|
||||
HAL_DCMI_IRQHandler(&DCMIHandle);
|
||||
}
|
||||
|
||||
void DMA2_Stream1_IRQHandler(void) {
|
||||
HAL_DMA_IRQHandler(DCMIHandle.DMA_Handle);
|
||||
}
|
||||
|
||||
static int extclk_config(int frequency)
|
||||
{
|
||||
#if (OMV_XCLK_SOURCE == OMV_XCLK_TIM)
|
||||
@ -203,7 +211,8 @@ static void dcmi_abort()
|
||||
// This stops the DCMI hardware from generating DMA requests immediately and then stops the DMA
|
||||
// hardware. Note that HAL_DMA_Abort is a blocking operation. Do not use this in an interrupt.
|
||||
|
||||
if (DCMI->CR & DCMI_CR_ENABLE) {
|
||||
if (DMAHandle.Instance != NULL &&
|
||||
DCMI->CR & DCMI_CR_ENABLE) {
|
||||
DCMI->CR &= ~DCMI_CR_ENABLE;
|
||||
HAL_DMA_Abort(&DMAHandle);
|
||||
}
|
||||
@ -521,6 +530,7 @@ int sensor_reset()
|
||||
|
||||
// Disable VSYNC EXTI IRQ
|
||||
HAL_NVIC_DisableIRQ(DCMI_VSYNC_IRQN);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,6 @@
|
||||
#include <stm32fxxx_it.h>
|
||||
|
||||
extern PCD_HandleTypeDef hpcd;
|
||||
extern DCMI_HandleTypeDef DCMIHandle;
|
||||
extern void DCMI_VsyncExtiCallback();
|
||||
extern TIM_HandleTypeDef TIM5_Handle;
|
||||
|
||||
@ -157,11 +156,3 @@ void OTG_HS_IRQHandler(void)
|
||||
{
|
||||
HAL_PCD_IRQHandler(&hpcd);
|
||||
}
|
||||
|
||||
void DCMI_IRQHandler(void) {
|
||||
HAL_DCMI_IRQHandler(&DCMIHandle);
|
||||
}
|
||||
|
||||
void DMA2_Stream1_IRQHandler(void) {
|
||||
HAL_DMA_IRQHandler(DCMIHandle.DMA_Handle);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user