diff options
author | Leo C | 2017-05-03 15:17:38 +0200 |
---|---|---|
committer | Leo C | 2017-05-03 15:17:38 +0200 |
commit | 1cb9eb4284372766bb9a4a0dad7727add2491a6b (patch) | |
tree | 1fe9303c4c6ca59ec99603fbba0058c747a13202 | |
parent | abe1abf37f4346cae787f99f438fa85bc6345c1d (diff) | |
download | irmp-demo-1cb9eb4284372766bb9a4a0dad7727add2491a6b.zip |
Change port pin for debug led to enable logging on usart2.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 4 | ||||
m--------- | irmp | 0 | ||||
-rw-r--r-- | irmp-main.c | 20 | ||||
-rw-r--r-- | irsnd-main.c | 10 |
5 files changed, 21 insertions, 14 deletions
@@ -1,6 +1,7 @@ *.elf *.map *.bin +*.list generated.*.ld *.i *.s @@ -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 -Subproject 9004ddf5192fdd2442dc2cbb0158f042c981702 +Subproject a5e9d0fec449df2e341cddb7f6055b14820d0bd 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
}
|