From 697859c29b7922577a78087cb39549a137eee1b6 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 2 Jul 2019 18:48:25 +0100 Subject: support new hardware for adapter --- app/main.c | 3 ++- app/project.h | 7 +++++-- app/ticker.c | 9 ++++++--- app/timex.c | 3 +++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/main.c b/app/main.c index 06644bd..31bd034 100644 --- a/app/main.c +++ b/app/main.c @@ -16,7 +16,8 @@ int main (void) rcc_periph_clock_enable (RCC_AFIO); nvic_set_priority (NVIC_SYSTICK_IRQ, 0x80); nvic_set_priority (NVIC_USART1_IRQ, 0x40); - gpio_set_mode (LED_BANK, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_OPENDRAIN, LED_GPIO); + gpio_set_mode (LED1_BANK, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_OPENDRAIN, LED1_GPIO); + gpio_set_mode (LED2_BANK, GPIO_MODE_OUTPUT_2_MHZ, GPIO_CNF_OUTPUT_OPENDRAIN, LED2_GPIO); timex_init(); ticker_init(); diff --git a/app/project.h b/app/project.h index 5731f0d..3baf0b2 100644 --- a/app/project.h +++ b/app/project.h @@ -22,8 +22,11 @@ #include #include -#define LED_GPIO GPIO13 -#define LED_BANK GPIOC +#define LED1_GPIO GPIO13 +#define LED1_BANK GPIOC + +#define LED2_GPIO GPIO12 +#define LED2_BANK GPIOB #include "ring.h" diff --git a/app/ticker.c b/app/ticker.c index ea832c8..9133493 100644 --- a/app/ticker.c +++ b/app/ticker.c @@ -24,10 +24,13 @@ sys_tick_handler (void) ticks++; if (led) { - gpio_clear (LED_BANK, LED_GPIO); + gpio_clear (LED1_BANK, LED1_GPIO); + gpio_clear (LED2_BANK, LED2_GPIO); led--; - } else - gpio_set (LED_BANK, LED_GPIO); + } else { + gpio_set (LED1_BANK, LED1_GPIO); + gpio_set (LED2_BANK, LED2_GPIO); + } } diff --git a/app/timex.c b/app/timex.c index a80843f..b2225ae 100644 --- a/app/timex.c +++ b/app/timex.c @@ -166,6 +166,9 @@ static int get_data (uint8_t *start, uint8_t *data) *start = 0; + if (state>STATE_MAGIC4) + led=32000; + switch (state) { case STATE_MAGIC0: -- cgit v1.2.3