summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@no.no.james.local>2019-07-02 18:48:25 +0100
committerroot <root@no.no.james.local>2019-07-02 18:50:13 +0100
commit697859c29b7922577a78087cb39549a137eee1b6 (patch)
tree3c214225e98df783e53d735b47210c1cd112a853
parent645b771533f289c146502ad91af5dfbd0d3af03f (diff)
downloadadapter-697859c29b7922577a78087cb39549a137eee1b6.tar.gz
adapter-697859c29b7922577a78087cb39549a137eee1b6.tar.bz2
adapter-697859c29b7922577a78087cb39549a137eee1b6.zip
support new hardware for adapter
-rw-r--r--app/main.c3
-rw-r--r--app/project.h7
-rw-r--r--app/ticker.c9
-rw-r--r--app/timex.c3
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 <stdio.h>
#include <errno.h>
-#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: