]> mj.ucw.cz Git - home-hw.git/commitdiff
ocm3 test: measuring temperature...
authorMartin Mares <mj@ucw.cz>
Mon, 1 Jul 2019 08:23:22 +0000 (10:23 +0200)
committerMartin Mares <mj@ucw.cz>
Mon, 1 Jul 2019 08:23:22 +0000 (10:23 +0200)
test-opencm3/ds18b20.c
test-opencm3/test.c

index 387a88cb046777227a5c64399679ddf8b081d5dd..fda6e83ef7580ebd3ad20046ed927e90038081bd 100644 (file)
@@ -18,7 +18,7 @@ static volatile u32 ds_dma_buffer;
 #define DS_DMA_CH 6
 
 #define DS_DEBUG
-#define DS_DEBUG2
+#undef DS_DEBUG2
 
 #ifdef DS_DEBUG
 #define DEBUG debug_printf
@@ -207,7 +207,6 @@ void ds_init(void)
        // FIXME: Configure precision
 }
 
-#if 0
 void ds_step(void)
 {
        static byte ds_running;
@@ -253,4 +252,3 @@ void ds_step(void)
                ds_current_temp = t;
        }
 }
-#endif
index bd73c870246a717e2b310fdf27622efbc21b8840..309fc759e6043945ced5d0ac03681f3bc8bf16fb 100644 (file)
@@ -37,7 +37,7 @@ static void tick_setup(void)
        systick_interrupt_enable();
 }
 
-void delay_ms(uint ms)
+static void delay_ms(uint ms)
 {
        u32 start_ticks = ms_ticks;
        while (ms_ticks - start_ticks < ms)
@@ -65,10 +65,11 @@ int main(void)
        tick_setup();
        usart_setup();
 
+       ds_init();
        for (;;) {
                gpio_toggle(GPIOC, GPIO13);
-               ds_init();
-               delay_ms(1000);
+               delay_ms(100);
+               ds_step();
        }
 
        return 0;