Hook up IRQ
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "Pins.h"
|
#include "Pins.h"
|
||||||
#include "fusbpd.h"
|
#include "fusbpd.h"
|
||||||
|
#include "int_n.h"
|
||||||
bool FUSB302_present = false;
|
bool FUSB302_present = false;
|
||||||
void power_probe() {
|
void power_probe() {
|
||||||
// If TS80 probe for QC
|
// If TS80 probe for QC
|
||||||
@@ -28,9 +29,12 @@ uint8_t usb_pd_detect() {
|
|||||||
GPIO_InitTypeDef GPIO_InitStruct;
|
GPIO_InitTypeDef GPIO_InitStruct;
|
||||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM;
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM;
|
||||||
GPIO_InitStruct.Pin = GPIO_PIN_9;
|
GPIO_InitStruct.Pin = GPIO_PIN_9;
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
|
||||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||||
|
HAL_NVIC_SetPriority(EXTI9_5_IRQn, 15, 0);
|
||||||
|
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
|
||||||
|
InterruptHandler::irqCallback();
|
||||||
return FUSB302_present;
|
return FUSB302_present;
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -82,3 +82,6 @@ void DMA1_Channel6_IRQHandler(void) {
|
|||||||
void DMA1_Channel7_IRQHandler(void) {
|
void DMA1_Channel7_IRQHandler(void) {
|
||||||
HAL_DMA_IRQHandler(&hdma_i2c1_rx);
|
HAL_DMA_IRQHandler(&hdma_i2c1_rx);
|
||||||
}
|
}
|
||||||
|
void EXTI9_5_IRQHandler(void){
|
||||||
|
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_9);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user