From 1cb9eb4284372766bb9a4a0dad7727add2491a6b Mon Sep 17 00:00:00 2001 From: Leo C Date: Wed, 3 May 2017 15:17:38 +0200 Subject: [PATCH] Change port pin for debug led to enable logging on usart2. --- .gitignore | 1 + Makefile | 4 ++-- irmp | 2 +- irmp-main.c | 20 +++++++++++++------- irsnd-main.c | 10 +++++----- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 0048fe1..d959ad0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.elf *.map *.bin +*.list generated.*.ld *.i *.s diff --git a/Makefile b/Makefile index 038a6e8..498aa1b 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,8 @@ DEFS += -DUSE_OPENCM3_API=0 #-DCON_BAUDRATE=38400 DEFS += -DDEBUG_IRMP_TIMER_INT=1 CFLAGS += -save-temps -BINARY = $(BINARY_irsnd) -OBJS = $(OBJS_irsnd) +BINARY = $(BINARY_irmp) +OBJS = $(OBJS_irmp) BINARY_irmp = irmp-main BINARY_irsnd= irsnd-main diff --git a/irmp b/irmp index 9004ddf..a5e9d0f 160000 --- a/irmp +++ b/irmp @@ -1 +1 @@ -Subproject commit 9004ddf5192fdd2442dc2cbb0158f042c981702e +Subproject commit a5e9d0fec449df2e341cddb7f6055b14820d0bd8 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 } diff --git a/irsnd-main.c b/irsnd-main.c index 903312c..38c0da6 100644 --- a/irsnd-main.c +++ b/irsnd-main.c @@ -42,9 +42,9 @@ #define LED_PORT_RCC RCC_GPIOC #if DEBUG_IRMP_TIMER_INT -#define DEBUG_LED_PORT GPIOA -#define DEBUG_LED_PIN GPIO2 -#define DEBUG_LED_PORT_RCC RCC_GPIOA +#define DEBUG_LED_PORT GPIOB +#define DEBUG_LED_PIN GPIO0 +#define DEBUG_LED_PORT_RCC RCC_GPIOB #endif /** @@ -88,7 +88,7 @@ static void debug_led_on(void) # if USE_OPENCM3_API /* Using API functions: */ gpio_clear(DEBUG_LED_PORT, DEBUG_LED_PIN); #else - GPIO_BRR(GPIOA) = GPIO2; + GPIO_BRR(DEBUG_LED_PORT) = DEBUG_LED_PIN; # endif #endif } @@ -99,7 +99,7 @@ static void debug_led_off(void) # if USE_OPENCM3_API /* Using API functions: */ gpio_set(DEBUG_LED_PORT, DEBUG_LED_PIN); #else - GPIO_BSRR(GPIOA) = GPIO2; + GPIO_BSRR(DEBUG_LED_PORT) = DEBUG_LED_PIN; # endif #endif } -- 2.39.2