From b3750541774c486fdabe504434fefe1de469dba4 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Fri, 23 Jun 2017 23:09:07 +0000 Subject: awd-timer-dma: initial commit. Had to figure out a few screwups before I got the AWD working properly. --- tests/awd-timer-dma/main-stm32l1-generic.c | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tests/awd-timer-dma/main-stm32l1-generic.c (limited to 'tests/awd-timer-dma/main-stm32l1-generic.c') diff --git a/tests/awd-timer-dma/main-stm32l1-generic.c b/tests/awd-timer-dma/main-stm32l1-generic.c new file mode 100644 index 0000000..17d6b2c --- /dev/null +++ b/tests/awd-timer-dma/main-stm32l1-generic.c @@ -0,0 +1,42 @@ +/* + * Oct 2015 Karl Palsson + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "trace.h" +#include "awd-timer-dma.h" + +#define LED_DISCO_GREEN_PORT GPIOB +#define LED_DISCO_GREEN_PIN GPIO7 + + +int main(void) +{ + int i; + int j = 0; + rcc_clock_setup_pll(&rcc_clock_config[RCC_CLOCK_VRANGE1_HSI_PLL_32MHZ]); + rcc_periph_clock_enable(RCC_GPIOB); + printf("hi guys!\n"); + /* green led for ticking */ + gpio_mode_setup(LED_DISCO_GREEN_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, + LED_DISCO_GREEN_PIN); + + task_init(); + while (1) { + task_run(); + for (i = 0; i < 0x100000; i++) { /* Wait a bit. */ + __asm__("NOP"); + } + } + + return 0; +} -- cgit