From 50b3c92d7ff7230b1527ba391ace74a876e404f1 Mon Sep 17 00:00:00 2001 From: chrysn Date: Thu, 13 Sep 2012 23:41:52 +0200 Subject: removed efm32lib examples they would have needed migration work from efm32lib to emlib, and depend on non-free cmsis anyway. --- .../olimex-em32-32g880f128-h/test-efm32lib/test.c | 115 --------------------- 1 file changed, 115 deletions(-) delete mode 100644 examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/test.c (limited to 'examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/test.c') diff --git a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/test.c b/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/test.c deleted file mode 100644 index 02954bb..0000000 --- a/examples/efm32/tinygecko/olimex-em32-32g880f128-h/test-efm32lib/test.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * This file is part of the libopencm3 project. - * - * Copyright (C) 2009 Uwe Hermann - * Copyright (C) 2012 chrysn - * - * This library is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library. If not, see . - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -void setup(void); -void led_toggle(void); -bool button_is_pressed(void); -void debug(int a); - -#define LOG_SIZE 1024 -volatile char logbuffer[LOG_SIZE]; - -int main(void) -{ - int x; - int n_pressed = 0; - - setup(); - - while(1) { - if (button_is_pressed()) - { - for(x = 0; x < 200000; ++x) asm("mov r0,r0"); /* no-op, prevent compiler from optimizing this away */ - n_pressed += 1; - debug(n_pressed); - } - led_toggle(); - }; -} - -void debug(int a) -{ - snprintf(logbuffer, LOG_SIZE, "Data %d.\n", a); -} - -void setup(void) -{ - // Before GPIO works, according to d0034_efm32tg_reference_manual.pdf - // note in section 28.3.7, we'll have to enable GPIO in CMU_HFPERCLKEN0 - - CMU->HFPERCLKEN0 |= _CMU_HFPERCLKEN0_GPIO_MASK; - - GPIO_PinModeSet(gpioPortE, 1, gpioModePushPull, 0); - GPIO_PinModeSet(gpioPortE, 2, gpioModePushPull, 0); - - GPIO_PinModeSet(gpioPortE, 0, gpioModeInputPull, 1); /* pull up */ - - // Counter-blink the other user LED - - GPIO_PinOutToggle(gpioPortE, 2); -} - -void led_toggle(void) -{ - GPIO_PinOutToggle(gpioPortE, 1); - GPIO_PinOutToggle(gpioPortE, 2); -} - -bool button_is_pressed(void) -{ - return !GPIO_PinInGet(gpioPortE, 0); -} -- cgit v1.2.3