mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-25 22:32:29 +03:00
Fix input (#166)
* fixed inline functions for modern C standart * Fix button-left and button-back setup code * *nix fix Co-authored-by: aanper <mail@s3f.ru>
This commit is contained in:
parent
59513b05ee
commit
364a8e6f6c
@ -60,6 +60,7 @@ void Error_Handler(void);
|
|||||||
/* Private defines -----------------------------------------------------------*/
|
/* Private defines -----------------------------------------------------------*/
|
||||||
#define BUTTON_BACK_Pin GPIO_PIN_13
|
#define BUTTON_BACK_Pin GPIO_PIN_13
|
||||||
#define BUTTON_BACK_GPIO_Port GPIOC
|
#define BUTTON_BACK_GPIO_Port GPIOC
|
||||||
|
#define BUTTON_BACK_EXTI_IRQn EXTI15_10_IRQn
|
||||||
#define CHRG_Pin GPIO_PIN_2
|
#define CHRG_Pin GPIO_PIN_2
|
||||||
#define CHRG_GPIO_Port GPIOC
|
#define CHRG_GPIO_Port GPIOC
|
||||||
#define CHRG_EXTI_IRQn EXTI2_IRQn
|
#define CHRG_EXTI_IRQn EXTI2_IRQn
|
||||||
|
@ -59,6 +59,7 @@ void EXTI2_IRQHandler(void);
|
|||||||
void EXTI4_IRQHandler(void);
|
void EXTI4_IRQHandler(void);
|
||||||
void EXTI9_5_IRQHandler(void);
|
void EXTI9_5_IRQHandler(void);
|
||||||
void TIM1_TRG_COM_TIM17_IRQHandler(void);
|
void TIM1_TRG_COM_TIM17_IRQHandler(void);
|
||||||
|
void EXTI15_10_IRQHandler(void);
|
||||||
void TIM8_CC_IRQHandler(void);
|
void TIM8_CC_IRQHandler(void);
|
||||||
void OTG_FS_IRQHandler(void);
|
void OTG_FS_IRQHandler(void);
|
||||||
/* USER CODE BEGIN EFP */
|
/* USER CODE BEGIN EFP */
|
||||||
|
@ -66,7 +66,7 @@ void MX_GPIO_Init(void)
|
|||||||
|
|
||||||
/*Configure GPIO pin : PtPin */
|
/*Configure GPIO pin : PtPin */
|
||||||
GPIO_InitStruct.Pin = BUTTON_BACK_Pin;
|
GPIO_InitStruct.Pin = BUTTON_BACK_Pin;
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
|
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
|
||||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
||||||
HAL_GPIO_Init(BUTTON_BACK_GPIO_Port, &GPIO_InitStruct);
|
HAL_GPIO_Init(BUTTON_BACK_GPIO_Port, &GPIO_InitStruct);
|
||||||
|
|
||||||
@ -108,8 +108,8 @@ void MX_GPIO_Init(void)
|
|||||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||||
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||||
|
|
||||||
/*Configure GPIO pins : PBPin PBPin PBPin */
|
/*Configure GPIO pins : PBPin PBPin PBPin PBPin */
|
||||||
GPIO_InitStruct.Pin = BUTTON_UP_Pin|BUTTON_RIGHT_Pin|BUTTON_OK_Pin;
|
GPIO_InitStruct.Pin = BUTTON_UP_Pin|BUTTON_LEFT_Pin|BUTTON_RIGHT_Pin|BUTTON_OK_Pin;
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
|
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;
|
||||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
||||||
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||||
@ -147,12 +147,6 @@ void MX_GPIO_Init(void)
|
|||||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
|
||||||
|
|
||||||
/*Configure GPIO pin : PtPin */
|
|
||||||
GPIO_InitStruct.Pin = BUTTON_LEFT_Pin;
|
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
|
|
||||||
GPIO_InitStruct.Pull = GPIO_PULLDOWN;
|
|
||||||
HAL_GPIO_Init(BUTTON_LEFT_GPIO_Port, &GPIO_InitStruct);
|
|
||||||
|
|
||||||
/*Configure GPIO pin : PtPin */
|
/*Configure GPIO pin : PtPin */
|
||||||
GPIO_InitStruct.Pin = CC1101_G0_Pin;
|
GPIO_InitStruct.Pin = CC1101_G0_Pin;
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
|
||||||
@ -175,6 +169,9 @@ void MX_GPIO_Init(void)
|
|||||||
HAL_NVIC_SetPriority(EXTI9_5_IRQn, 5, 0);
|
HAL_NVIC_SetPriority(EXTI9_5_IRQn, 5, 0);
|
||||||
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
|
HAL_NVIC_EnableIRQ(EXTI9_5_IRQn);
|
||||||
|
|
||||||
|
HAL_NVIC_SetPriority(EXTI15_10_IRQn, 5, 0);
|
||||||
|
HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
|
@ -245,6 +245,20 @@ void TIM1_TRG_COM_TIM17_IRQHandler(void)
|
|||||||
/* USER CODE END TIM1_TRG_COM_TIM17_IRQn 1 */
|
/* USER CODE END TIM1_TRG_COM_TIM17_IRQn 1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles EXTI line[15:10] interrupts.
|
||||||
|
*/
|
||||||
|
void EXTI15_10_IRQHandler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN EXTI15_10_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END EXTI15_10_IRQn 0 */
|
||||||
|
HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13);
|
||||||
|
/* USER CODE BEGIN EXTI15_10_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END EXTI15_10_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function handles TIM8 capture compare interrupt.
|
* @brief This function handles TIM8 capture compare interrupt.
|
||||||
*/
|
*/
|
||||||
|
@ -35,6 +35,7 @@ PA14\ (JTCK-SWCLK).Signal=SYS_JTCK-SWCLK
|
|||||||
RCC.LPTIM1Freq_Value=64000000
|
RCC.LPTIM1Freq_Value=64000000
|
||||||
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false
|
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false
|
||||||
NVIC.EXTI1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true
|
NVIC.EXTI1_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true
|
||||||
|
PB4\ (NJTRST).GPIO_ModeDefaultEXTI=GPIO_MODE_IT_RISING_FALLING
|
||||||
RCC.ADCCLockSelection=RCC_ADCCLKSOURCE_SYSCLK
|
RCC.ADCCLockSelection=RCC_ADCCLKSOURCE_SYSCLK
|
||||||
SPI1.Direction=SPI_DIRECTION_2LINES
|
SPI1.Direction=SPI_DIRECTION_2LINES
|
||||||
RCC.APB2TimFreq_Value=64000000
|
RCC.APB2TimFreq_Value=64000000
|
||||||
@ -47,6 +48,7 @@ PA1.GPIO_PuPd=GPIO_PULLDOWN
|
|||||||
RCC.PREFETCH_ENABLE=1
|
RCC.PREFETCH_ENABLE=1
|
||||||
PB13.Locked=true
|
PB13.Locked=true
|
||||||
RCC.USART3Freq_Value=64000000
|
RCC.USART3Freq_Value=64000000
|
||||||
|
NVIC.EXTI15_10_IRQn=true\:5\:0\:true\:false\:true\:false\:true\:true
|
||||||
ProjectManager.ProjectBuild=false
|
ProjectManager.ProjectBuild=false
|
||||||
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||||
PA0.Locked=true
|
PA0.Locked=true
|
||||||
@ -214,8 +216,8 @@ ADC1.master=1
|
|||||||
PA3.Locked=true
|
PA3.Locked=true
|
||||||
Mcu.Pin21=PB2
|
Mcu.Pin21=PB2
|
||||||
PA10.Locked=true
|
PA10.Locked=true
|
||||||
NVIC.ForceEnableDMAVector=true
|
|
||||||
PA14\ (JTCK-SWCLK).Locked=true
|
PA14\ (JTCK-SWCLK).Locked=true
|
||||||
|
NVIC.ForceEnableDMAVector=true
|
||||||
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
|
||||||
ProjectManager.CompilerOptimize=6
|
ProjectManager.CompilerOptimize=6
|
||||||
PA11.Signal=USB_OTG_FS_DM
|
PA11.Signal=USB_OTG_FS_DM
|
||||||
@ -314,6 +316,7 @@ Mcu.Pin0=PC13
|
|||||||
SPI3.DataSize=SPI_DATASIZE_8BIT
|
SPI3.DataSize=SPI_DATASIZE_8BIT
|
||||||
Mcu.Pin1=PC14-OSC32_IN (PC14)
|
Mcu.Pin1=PC14-OSC32_IN (PC14)
|
||||||
TIM8.IPParameters=Channel-Input_Capture2_from_TI2,ICPolarity_CH2,Prescaler,Period
|
TIM8.IPParameters=Channel-Input_Capture2_from_TI2,ICPolarity_CH2,Prescaler,Period
|
||||||
|
GPIO.groupedBy=Group By Peripherals
|
||||||
Mcu.Pin2=PC15-OSC32_OUT (PC15)
|
Mcu.Pin2=PC15-OSC32_OUT (PC15)
|
||||||
Mcu.Pin3=PH0-OSC_IN (PH0)
|
Mcu.Pin3=PH0-OSC_IN (PH0)
|
||||||
Mcu.Pin4=PH1-OSC_OUT (PH1)
|
Mcu.Pin4=PH1-OSC_OUT (PH1)
|
||||||
@ -399,7 +402,7 @@ PC8.GPIO_Label=DISPLAY_CS
|
|||||||
USART1.VirtualMode-Asynchronous=VM_ASYNC
|
USART1.VirtualMode-Asynchronous=VM_ASYNC
|
||||||
FREERTOS.configUSE_IDLE_HOOK=1
|
FREERTOS.configUSE_IDLE_HOOK=1
|
||||||
PA9.Mode=Asynchronous
|
PA9.Mode=Asynchronous
|
||||||
PB4\ (NJTRST).GPIOParameters=GPIO_PuPd,GPIO_Label
|
PB4\ (NJTRST).GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI
|
||||||
NVIC.TIM8_CC_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true
|
NVIC.TIM8_CC_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true
|
||||||
PB14.PinState=GPIO_PIN_SET
|
PB14.PinState=GPIO_PIN_SET
|
||||||
ProjectManager.TargetToolchain=Makefile
|
ProjectManager.TargetToolchain=Makefile
|
||||||
@ -425,7 +428,7 @@ RCC.UART4Freq_Value=64000000
|
|||||||
SPI3.CalculateBaudRate=1000.0 KBits/s
|
SPI3.CalculateBaudRate=1000.0 KBits/s
|
||||||
MxCube.Version=6.0.1
|
MxCube.Version=6.0.1
|
||||||
PA13\ (JTMS-SWDIO).GPIO_Label=TMS
|
PA13\ (JTMS-SWDIO).GPIO_Label=TMS
|
||||||
PC13.GPIOParameters=GPIO_PuPd,GPIO_Label
|
PC13.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI
|
||||||
RCC.PLLSAI1QoutputFreq_Value=48000000
|
RCC.PLLSAI1QoutputFreq_Value=48000000
|
||||||
RCC.ADCFreq_Value=64000000
|
RCC.ADCFreq_Value=64000000
|
||||||
SPI3.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_64
|
SPI3.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_64
|
||||||
@ -456,6 +459,7 @@ SH.GPXTI4.0=GPIO_EXTI4
|
|||||||
RCC.PLLSAI2PoutputFreq_Value=9142857.142857144
|
RCC.PLLSAI2PoutputFreq_Value=9142857.142857144
|
||||||
KeepUserPlacement=false
|
KeepUserPlacement=false
|
||||||
TIM5.Prescaler=500 - 1
|
TIM5.Prescaler=500 - 1
|
||||||
|
PC13.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_RISING_FALLING
|
||||||
PC5.GPIO_Label=RFID_RF_IN
|
PC5.GPIO_Label=RFID_RF_IN
|
||||||
PC14-OSC32_IN\ (PC14).Signal=RCC_OSC32_IN
|
PC14-OSC32_IN\ (PC14).Signal=RCC_OSC32_IN
|
||||||
SH.GPXTI9.ConfNb=1
|
SH.GPXTI9.ConfNb=1
|
||||||
|
Loading…
Reference in New Issue
Block a user