[FL-2392] FuriHal: refactor interrupts subsystem (#1066)
* FuriHal: refactor interrupts subsystem * Furi,FuriHal: gather all ISRs under interrupt API, improve crtitical section and cleanup garbage * FuriHal: mirgate ipcc and hsem to LL * Format Sources * FuriHal,BleGlue: move to new critical section * Format Sources * FuriHal: correct flash locking * FuriHal: replace critical section with interrupt disable in OS routine, minor fixex
This commit is contained in:
@@ -5,117 +5,112 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include "stm32wbxx_hal.h"
|
||||
#include "stm32wbxx_ll_gpio.h"
|
||||
|
||||
void Error_Handler(void);
|
||||
|
||||
#define BUTTON_BACK_EXTI_IRQn EXTI15_10_IRQn
|
||||
#define BUTTON_BACK_GPIO_Port GPIOC
|
||||
#define BUTTON_BACK_Pin GPIO_PIN_13
|
||||
#define BUTTON_DOWN_EXTI_IRQn EXTI6_IRQn
|
||||
#define BUTTON_BACK_Pin LL_GPIO_PIN_13
|
||||
#define BUTTON_DOWN_GPIO_Port GPIOC
|
||||
#define BUTTON_DOWN_Pin GPIO_PIN_6
|
||||
#define BUTTON_LEFT_EXTI_IRQn EXTI15_10_IRQn
|
||||
#define BUTTON_DOWN_Pin LL_GPIO_PIN_6
|
||||
#define BUTTON_LEFT_GPIO_Port GPIOB
|
||||
#define BUTTON_LEFT_Pin GPIO_PIN_11
|
||||
#define BUTTON_OK_EXTI_IRQn EXTI3_IRQn
|
||||
#define BUTTON_LEFT_Pin LL_GPIO_PIN_11
|
||||
#define BUTTON_OK_GPIO_Port GPIOH
|
||||
#define BUTTON_OK_Pin GPIO_PIN_3
|
||||
#define BUTTON_RIGHT_EXTI_IRQn EXTI15_10_IRQn
|
||||
#define BUTTON_OK_Pin LL_GPIO_PIN_3
|
||||
#define BUTTON_RIGHT_GPIO_Port GPIOB
|
||||
#define BUTTON_RIGHT_Pin GPIO_PIN_12
|
||||
#define BUTTON_UP_EXTI_IRQn EXTI15_10_IRQn
|
||||
#define BUTTON_RIGHT_Pin LL_GPIO_PIN_12
|
||||
#define BUTTON_UP_GPIO_Port GPIOB
|
||||
#define BUTTON_UP_Pin GPIO_PIN_10
|
||||
#define BUTTON_UP_Pin LL_GPIO_PIN_10
|
||||
|
||||
#define CC1101_CS_GPIO_Port GPIOD
|
||||
#define CC1101_CS_Pin GPIO_PIN_0
|
||||
#define CC1101_CS_Pin LL_GPIO_PIN_0
|
||||
#define CC1101_G0_GPIO_Port GPIOA
|
||||
#define CC1101_G0_Pin GPIO_PIN_1
|
||||
#define CC1101_G0_Pin LL_GPIO_PIN_1
|
||||
|
||||
#define DISPLAY_CS_GPIO_Port GPIOC
|
||||
#define DISPLAY_CS_Pin GPIO_PIN_11
|
||||
#define DISPLAY_CS_Pin LL_GPIO_PIN_11
|
||||
#define DISPLAY_DI_GPIO_Port GPIOB
|
||||
#define DISPLAY_DI_Pin GPIO_PIN_1
|
||||
#define DISPLAY_DI_Pin LL_GPIO_PIN_1
|
||||
#define DISPLAY_RST_GPIO_Port GPIOB
|
||||
#define DISPLAY_RST_Pin GPIO_PIN_0
|
||||
#define DISPLAY_RST_Pin LL_GPIO_PIN_0
|
||||
|
||||
#define IR_RX_GPIO_Port GPIOA
|
||||
#define IR_RX_Pin GPIO_PIN_0
|
||||
#define IR_RX_Pin LL_GPIO_PIN_0
|
||||
#define IR_TX_GPIO_Port GPIOB
|
||||
#define IR_TX_Pin GPIO_PIN_9
|
||||
#define IR_TX_Pin LL_GPIO_PIN_9
|
||||
|
||||
#define NFC_CS_GPIO_Port GPIOE
|
||||
#define NFC_CS_Pin GPIO_PIN_4
|
||||
#define NFC_CS_Pin LL_GPIO_PIN_4
|
||||
|
||||
#define PA4_GPIO_Port GPIOA
|
||||
#define PA4_Pin GPIO_PIN_4
|
||||
#define PA4_Pin LL_GPIO_PIN_4
|
||||
#define PA6_GPIO_Port GPIOA
|
||||
#define PA6_Pin GPIO_PIN_6
|
||||
#define PA6_Pin LL_GPIO_PIN_6
|
||||
#define PA7_GPIO_Port GPIOA
|
||||
#define PA7_Pin GPIO_PIN_7
|
||||
#define PA7_Pin LL_GPIO_PIN_7
|
||||
#define PB2_GPIO_Port GPIOB
|
||||
#define PB2_Pin GPIO_PIN_2
|
||||
#define PB2_Pin LL_GPIO_PIN_2
|
||||
#define PB3_GPIO_Port GPIOB
|
||||
#define PB3_Pin GPIO_PIN_3
|
||||
#define PB3_Pin LL_GPIO_PIN_3
|
||||
#define PC0_GPIO_Port GPIOC
|
||||
#define PC0_Pin GPIO_PIN_0
|
||||
#define PC0_Pin LL_GPIO_PIN_0
|
||||
#define PC1_GPIO_Port GPIOC
|
||||
#define PC1_Pin GPIO_PIN_1
|
||||
#define PC1_Pin LL_GPIO_PIN_1
|
||||
#define PC3_GPIO_Port GPIOC
|
||||
#define PC3_Pin GPIO_PIN_3
|
||||
#define PC3_Pin LL_GPIO_PIN_3
|
||||
|
||||
#define PERIPH_POWER_GPIO_Port GPIOA
|
||||
#define PERIPH_POWER_Pin GPIO_PIN_3
|
||||
#define PERIPH_POWER_Pin LL_GPIO_PIN_3
|
||||
|
||||
#define QUARTZ_32MHZ_IN_GPIO_Port GPIOC
|
||||
#define QUARTZ_32MHZ_IN_Pin GPIO_PIN_14
|
||||
#define QUARTZ_32MHZ_IN_Pin LL_GPIO_PIN_14
|
||||
#define QUARTZ_32MHZ_OUT_GPIO_Port GPIOC
|
||||
#define QUARTZ_32MHZ_OUT_Pin GPIO_PIN_15
|
||||
#define QUARTZ_32MHZ_OUT_Pin LL_GPIO_PIN_15
|
||||
|
||||
#define RFID_OUT_GPIO_Port GPIOB
|
||||
#define RFID_OUT_Pin GPIO_PIN_13
|
||||
#define RFID_OUT_Pin LL_GPIO_PIN_13
|
||||
#define RFID_PULL_GPIO_Port GPIOA
|
||||
#define RFID_PULL_Pin GPIO_PIN_2
|
||||
#define RFID_PULL_Pin LL_GPIO_PIN_2
|
||||
#define RFID_RF_IN_GPIO_Port GPIOC
|
||||
#define RFID_RF_IN_Pin GPIO_PIN_5
|
||||
#define RFID_RF_IN_Pin LL_GPIO_PIN_5
|
||||
#define RFID_CARRIER_GPIO_Port GPIOA
|
||||
#define RFID_CARRIER_Pin GPIO_PIN_15
|
||||
#define RFID_CARRIER_Pin LL_GPIO_PIN_15
|
||||
|
||||
#define RF_SW_0_GPIO_Port GPIOC
|
||||
#define RF_SW_0_Pin GPIO_PIN_4
|
||||
#define RF_SW_0_Pin LL_GPIO_PIN_4
|
||||
|
||||
#define SD_CD_GPIO_Port GPIOC
|
||||
#define SD_CD_Pin GPIO_PIN_10
|
||||
#define SD_CD_Pin LL_GPIO_PIN_10
|
||||
#define SD_CS_GPIO_Port GPIOC
|
||||
#define SD_CS_Pin GPIO_PIN_12
|
||||
#define SD_CS_Pin LL_GPIO_PIN_12
|
||||
|
||||
#define SPEAKER_GPIO_Port GPIOB
|
||||
#define SPEAKER_Pin GPIO_PIN_8
|
||||
#define SPEAKER_Pin LL_GPIO_PIN_8
|
||||
|
||||
#define VIBRO_GPIO_Port GPIOA
|
||||
#define VIBRO_Pin GPIO_PIN_8
|
||||
#define VIBRO_Pin LL_GPIO_PIN_8
|
||||
|
||||
#define iBTN_GPIO_Port GPIOB
|
||||
#define iBTN_Pin GPIO_PIN_14
|
||||
#define iBTN_Pin LL_GPIO_PIN_14
|
||||
|
||||
#define USART1_TX_Pin GPIO_PIN_6
|
||||
#define USART1_TX_Pin LL_GPIO_PIN_6
|
||||
#define USART1_TX_Port GPIOB
|
||||
#define USART1_RX_Pin GPIO_PIN_7
|
||||
#define USART1_RX_Pin LL_GPIO_PIN_7
|
||||
#define USART1_RX_Port GPIOB
|
||||
|
||||
#define SPI_D_MISO_GPIO_Port GPIOC
|
||||
#define SPI_D_MISO_Pin GPIO_PIN_2
|
||||
#define SPI_D_MISO_Pin LL_GPIO_PIN_2
|
||||
#define SPI_D_MOSI_GPIO_Port GPIOB
|
||||
#define SPI_D_MOSI_Pin GPIO_PIN_15
|
||||
#define SPI_D_MOSI_Pin LL_GPIO_PIN_15
|
||||
#define SPI_D_SCK_GPIO_Port GPIOD
|
||||
#define SPI_D_SCK_Pin GPIO_PIN_1
|
||||
#define SPI_D_SCK_Pin LL_GPIO_PIN_1
|
||||
|
||||
#define SPI_R_MISO_GPIO_Port GPIOB
|
||||
#define SPI_R_MISO_Pin GPIO_PIN_4
|
||||
#define SPI_R_MISO_Pin LL_GPIO_PIN_4
|
||||
#define SPI_R_MOSI_GPIO_Port GPIOB
|
||||
#define SPI_R_MOSI_Pin GPIO_PIN_5
|
||||
#define SPI_R_MOSI_Pin LL_GPIO_PIN_5
|
||||
#define SPI_R_SCK_GPIO_Port GPIOA
|
||||
#define SPI_R_SCK_Pin GPIO_PIN_5
|
||||
#define SPI_R_SCK_Pin LL_GPIO_PIN_5
|
||||
|
||||
#define NFC_IRQ_Pin RFID_PULL_Pin
|
||||
#define NFC_IRQ_GPIO_Port RFID_PULL_GPIO_Port
|
||||
|
@@ -37,7 +37,7 @@ extern "C" {
|
||||
#define HAL_CRYP_MODULE_ENABLED
|
||||
/*#define HAL_COMP_MODULE_ENABLED */
|
||||
/*#define HAL_CRC_MODULE_ENABLED */
|
||||
#define HAL_HSEM_MODULE_ENABLED
|
||||
/*#define HAL_HSEM_MODULE_ENABLED */
|
||||
/*#define HAL_I2C_MODULE_ENABLED */
|
||||
/*#define HAL_IPCC_MODULE_ENABLED */
|
||||
/*#define HAL_IRDA_MODULE_ENABLED */
|
||||
|
@@ -1,69 +0,0 @@
|
||||
/* USER CODE BEGIN Header */
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file stm32wbxx_it.h
|
||||
* @brief This file contains the headers of the interrupt handlers.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2020 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under Ultimate Liberty license
|
||||
* SLA0044, the "License"; You may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at:
|
||||
* www.st.com/SLA0044
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
/* USER CODE END Header */
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32WBxx_IT_H
|
||||
#define __STM32WBxx_IT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN ET */
|
||||
|
||||
/* USER CODE END ET */
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EC */
|
||||
|
||||
/* USER CODE END EC */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN EM */
|
||||
|
||||
/* USER CODE END EM */
|
||||
|
||||
/* Exported functions prototypes ---------------------------------------------*/
|
||||
void SysTick_Handler(void);
|
||||
void ADC1_IRQHandler(void);
|
||||
void USB_LP_IRQHandler(void);
|
||||
void COMP_IRQHandler(void);
|
||||
void TIM1_UP_TIM16_IRQHandler(void);
|
||||
void TIM1_TRG_COM_TIM17_IRQHandler(void);
|
||||
void TIM1_CC_IRQHandler(void);
|
||||
void TIM2_IRQHandler(void);
|
||||
void HSEM_IRQHandler(void);
|
||||
/* USER CODE BEGIN EFP */
|
||||
|
||||
/* USER CODE END EFP */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32WBxx_IT_H */
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
Reference in New Issue
Block a user