1
0
forked from me/IronOS

Hook up IRQ

This commit is contained in:
Ben V. Brown
2020-06-17 18:22:43 +10:00
parent 43b7947645
commit c70689df7d
2 changed files with 8 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
#include "Settings.h"
#include "Pins.h"
#include "fusbpd.h"
#include "int_n.h"
bool FUSB302_present = false;
void power_probe() {
// If TS80 probe for QC
@@ -28,9 +29,12 @@ uint8_t usb_pd_detect() {
GPIO_InitTypeDef GPIO_InitStruct;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM;
GPIO_InitStruct.Pin = GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
GPIO_InitStruct.Pull = GPIO_PULLUP;
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;
#endif
return false;

View File

@@ -82,3 +82,6 @@ void DMA1_Channel6_IRQHandler(void) {
void DMA1_Channel7_IRQHandler(void) {
HAL_DMA_IRQHandler(&hdma_i2c1_rx);
}
void EXTI9_5_IRQHandler(void){
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_9);
}