diff options
author | jaseg <git@jaseg.net> | 2018-07-17 15:43:26 +0200 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2018-07-17 15:43:26 +0200 |
commit | 6df66b77ba5b27bce5630694742f2dac57b8d3eb (patch) | |
tree | fc14370fdea41b6d7a672758aa89886b9107f78c /tests/qemu/main.c | |
parent | 90ce052d82daa86e1e86ab4dac7fbba0cdda8680 (diff) | |
download | olsndot-6df66b77ba5b27bce5630694742f2dac57b8d3eb.tar.gz olsndot-6df66b77ba5b27bce5630694742f2dac57b8d3eb.tar.bz2 olsndot-6df66b77ba5b27bce5630694742f2dac57b8d3eb.zip |
Isolate usb-serial-rs485 tree
Diffstat (limited to 'tests/qemu/main.c')
-rw-r--r-- | tests/qemu/main.c | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/tests/qemu/main.c b/tests/qemu/main.c deleted file mode 100644 index 863ce9e..0000000 --- a/tests/qemu/main.c +++ /dev/null @@ -1,58 +0,0 @@ -#include <libopencm3/cm3/nvic.h>
-#include <libopencm3/cm3/systick.h>
-
-
-/* LM3S Specifics, usart and RCC */
-#include <libopencm3/lm3s/rcc.h>
-#include <libopencm3/lm3s/usart.h>
-
-static volatile uint32_t jiffies = 0u;
-
-static void printbanner(void)
-{
- char msg[] = "One second elapsed!\r\n";
- char *c = msg;
- while (*c != 0) {
- usart_send(USART0_BASE, (uint16_t )*c);
- c++;
- }
-}
-
-void sys_tick_handler(void)
-{
- jiffies++;
-}
-
-static inline uint32_t systick_app_config(uint32_t n_ticks)
-{
- /* constant from systick_set_reload -- as this returns something that's
- * * not void, this is the only possible error condition */
- if (n_ticks & ~0x00FFFFFF) {
- return 1;
- }
-
- systick_set_reload(n_ticks);
- systick_set_clocksource(1);
- systick_interrupt_enable();
- systick_counter_enable();
-
- return 0;
-}
-
-#define HZ 1000
-
-int main(void)
-{
- uint32_t last_time = 0;
- rcc_clock_setup_in_xtal_8mhz_out_50mhz();
- systick_app_config(HZ);
-
- nvic_set_priority(NVIC_SYSTICK_IRQ, 0);
- jiffies = 0;
- while(1) {
- if (jiffies > HZ) {
- printbanner();
- jiffies = 0;
- }
- }
-}
|