X-Git-Url: http://cloudbase.mooo.com/gitweb/irmp-demo.git/blobdiff_plain/dbc48aa1421046023911f4fd12fa558becff11a5..refs/heads/master:/irmp-main.c diff --git a/irmp-main.c b/irmp-main.c index e7e04dd..bc6623b 100644 --- a/irmp-main.c +++ b/irmp-main.c @@ -41,6 +41,12 @@ #define DEBUG_IRMP_TIMER_INT 0 #endif +#if DEBUG_IRMP_TIMER_INT +#define DEBUG_LED_PORT GPIOB +#define DEBUG_LED_PIN GPIO0 +#define DEBUG_LED_PORT_RCC RCC_GPIOB +#endif + /** * Do all initialisations, that are not done by a specific module here. */ @@ -113,9 +119,9 @@ void irmp_timer_init (void) { #if DEBUG_IRMP_TIMER_INT /* Output pin for debugging */ - rcc_periph_clock_enable(RCC_GPIOA); - gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ, - GPIO_CNF_OUTPUT_PUSHPULL, GPIO2); + rcc_periph_clock_enable(DEBUG_LED_PORT_RCC); + gpio_set_mode(DEBUG_LED_PORT, GPIO_MODE_OUTPUT_2_MHZ, + GPIO_CNF_OUTPUT_PUSHPULL, DEBUG_LED_PIN); #endif /* Enable timer clock. */ rcc_periph_clock_enable(IRMP_TIMER_RCC); @@ -156,11 +162,11 @@ void IRMP_TIMER_ISR(void) #if DEBUG_IRMP_TIMER_INT # if USE_OPENCM3_API /* Using API functions: */ - gpio_clear(GPIOA, GPIO2); + gpio_clear(DEBUG_LED_PORT, DEBUG_LED_PIN); /* Clear update interrupt flag. */ timer_clear_flag(IRMP_TIMER, TIM_SR_UIF); # else /* Manually */ - GPIO_BRR(GPIOA) = GPIO2; + GPIO_BRR(DEBUG_LED_PORT) = DEBUG_LED_PIN; # endif #endif /* Clear update interrupt flag. */ @@ -172,9 +178,9 @@ void IRMP_TIMER_ISR(void) #if DEBUG_IRMP_TIMER_INT # if USE_OPENCM3_API /* Using API functions: */ - gpio_set(GPIOA, GPIO2); + gpio_set(DEBUG_LED_PORT, DEBUG_LED_PIN); # else /* Manually */ - GPIO_BSRR(GPIOA) = GPIO2; + GPIO_BSRR(DEBUG_LED_PORT) = DEBUG_LED_PIN; # endif #endif }