summaryrefslogtreecommitdiff
path: root/bluefnorf/main.c
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2018-07-14 10:57:22 +0200
committerjaseg <git@jaseg.net>2018-07-14 10:57:22 +0200
commit7c871bbc87159b4b0b98cb44390ee6bba57e6803 (patch)
tree4d07519a60a375f8bfcc859374d5e801e9e49a5d /bluefnorf/main.c
parent5b5a380a4b7d1d5f4adc288e0b6759631c7b893d (diff)
parent643208f4898400fb04bf0773c388551f58b0b5bf (diff)
downloadolsndot-7c871bbc87159b4b0b98cb44390ee6bba57e6803.tar.gz
olsndot-7c871bbc87159b4b0b98cb44390ee6bba57e6803.tar.bz2
olsndot-7c871bbc87159b4b0b98cb44390ee6bba57e6803.zip
Merge branch 'master' of github.com:jaseg/led_drv
Diffstat (limited to 'bluefnorf/main.c')
-rw-r--r--bluefnorf/main.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/bluefnorf/main.c b/bluefnorf/main.c
new file mode 100644
index 0000000..be45068
--- /dev/null
+++ b/bluefnorf/main.c
@@ -0,0 +1,39 @@
+/*
+ * ADC test: Try to get as many samples as possible
+ * using fast interleave mode and DMA
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include <libopencm3/cm3/nvic.h>
+#include <libopencm3/stm32/rcc.h>
+#include <libopencm3/stm32/gpio.h>
+#include <libopencm3/stm32/adc.h>
+#include <libopencm3/stm32/dma.h>
+
+#include "usb.h"
+
+int main(void)
+{
+ int i = 0;
+ // const char* line;
+
+ // Clock Setup
+ rcc_clock_setup_in_hse_8mhz_out_72mhz();
+
+ // Initialize USB
+ usb_serial_init();
+
+ while (1) {
+ /*
+ if( i % 100000 == 0 ) {
+ // Read ADC
+ printf("Fnord 42 :: %d %d\r\n", _adc_samples[0], _adc_samples[1]);
+ }
+ */
+
+ i++;
+ }
+}