Skip to content

Commit

Permalink
Implemented software debounce for channel select button.
Browse files Browse the repository at this point in the history
  • Loading branch information
drdpj committed Jun 9, 2019
1 parent f5ad41c commit c3aa4ff
Show file tree
Hide file tree
Showing 9 changed files with 183 additions and 187 deletions.
2 changes: 1 addition & 1 deletion Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
/* #define STM32F102x6 */ /*!< STM32F102C4, STM32F102R4, STM32F102C6 and STM32F102R6 */
/* #define STM32F102xB */ /*!< STM32F102C8, STM32F102R8, STM32F102CB and STM32F102RB */
/* #define STM32F103x6 */ /*!< STM32F103C4, STM32F103R4, STM32F103T4, STM32F103C6, STM32F103R6 and STM32F103T6 */
#define STM32F103xB /*!< STM32F103C8, STM32F103R8, STM32F103T8, STM32F103V8, STM32F103CB, STM32F103RB, STM32F103TB and STM32F103VB */
#define STM32F103xB /*!< STM32F103C8, STM32F103R8, STM32F103T8, STM32F103V8, STM32F103CB, STM32F103RB, STM32F103TB and STM32F103VB */
/* #define STM32F103xE */ /*!< STM32F103RC, STM32F103VC, STM32F103ZC, STM32F103RD, STM32F103VD, STM32F103ZD, STM32F103RE, STM32F103VE and STM32F103ZE */
/* #define STM32F103xG */ /*!< STM32F103RF, STM32F103VF, STM32F103ZF, STM32F103RG, STM32F103VG and STM32F103ZG */
/* #define STM32F105xC */ /*!< STM32F105R8, STM32F105V8, STM32F105RB, STM32F105VB, STM32F105RC and STM32F105VC */
Expand Down
1 change: 0 additions & 1 deletion Inc/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ void Error_Handler(void);
#define program_led_GPIO_Port GPIOA
#define button_Pin GPIO_PIN_5
#define button_GPIO_Port GPIOA
#define button_EXTI_IRQn EXTI9_5_IRQn
/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */
Expand Down
1 change: 0 additions & 1 deletion Inc/stm32f1xx_it.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ void SVC_Handler(void);
void DebugMon_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
void EXTI9_5_IRQHandler(void);
void SPI2_IRQHandler(void);
void USART2_IRQHandler(void);
/* USER CODE BEGIN EFP */
Expand Down
2 changes: 2 additions & 0 deletions Inc/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include"main.h"


/**
* Ring buffer struct
*/
Expand All @@ -28,3 +29,4 @@ struct rb {
volatile uint8_t writeIndex;
};

void Button_Pushed(void);
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##########################################################################################################################
# File automatically-generated by tool: [projectgenerator] version: [3.2.0] date: [Sun Jun 09 07:42:21 BST 2019]
# File automatically-generated by tool: [projectgenerator] version: [3.2.0] date: [Sun Jun 09 11:21:59 BST 2019]
##########################################################################################################################

# ------------------------------------------------
Expand Down Expand Up @@ -39,6 +39,7 @@ C_SOURCES = \
Src/main.c \
Src/stm32f1xx_it.c \
Src/stm32f1xx_hal_msp.c \
Src/utilities.c \
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c \
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.c \
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi_ex.c \
Expand Down
8 changes: 2 additions & 6 deletions MidiKeyboardBluePill.ioc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ MxCube.Version=5.2.0
MxDb.Version=DB.5.0.20
NVIC.BusFault_IRQn=true\:2\:0\:true\:false\:true\:true\:false
NVIC.DebugMonitor_IRQn=true\:2\:0\:true\:false\:true\:true\:false
NVIC.EXTI9_5_IRQn=true\:2\:0\:true\:false\:true\:true\:true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:true\:false
NVIC.MemoryManagement_IRQn=true\:2\:0\:true\:false\:true\:true\:false
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:true\:false
Expand All @@ -61,12 +60,11 @@ PA4.GPIO_Label=program-led
PA4.Locked=true
PA4.PinState=GPIO_PIN_SET
PA4.Signal=GPIO_Output
PA5.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI
PA5.GPIOParameters=GPIO_PuPd,GPIO_Label
PA5.GPIO_Label=button
PA5.GPIO_ModeDefaultEXTI=GPIO_MODE_IT_FALLING
PA5.GPIO_PuPd=GPIO_PULLUP
PA5.Locked=true
PA5.Signal=GPXTI5
PA5.Signal=GPIO_Input
PB10.GPIOParameters=GPIO_Speed,PinState,GPIO_PuPd,GPIO_ModeDefaultOutputPP
PB10.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP
PB10.GPIO_PuPd=GPIO_NOPULL
Expand Down Expand Up @@ -193,8 +191,6 @@ RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
RCC.TimSysFreq_Value=72000000
RCC.USBFreq_Value=72000000
RCC.VCOOutput2Freq_Value=8000000
SH.GPXTI5.0=GPIO_EXTI5
SH.GPXTI5.ConfNb=1
SPI2.CLKPhase=SPI_PHASE_2EDGE
SPI2.CLKPolarity=SPI_POLARITY_HIGH
SPI2.CalculateBaudRate=18.0 MBits/s
Expand Down
Loading

0 comments on commit c3aa4ff

Please sign in to comment.