From: Martin Mares Date: Mon, 1 Jul 2019 08:23:22 +0000 (+0200) Subject: ocm3 test: measuring temperature... X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=5f30fc3f24fb95a4ff745d3a8fadd0b4e4affaa3;p=home-hw.git ocm3 test: measuring temperature... --- diff --git a/test-opencm3/ds18b20.c b/test-opencm3/ds18b20.c index 387a88c..fda6e83 100644 --- a/test-opencm3/ds18b20.c +++ b/test-opencm3/ds18b20.c @@ -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 diff --git a/test-opencm3/test.c b/test-opencm3/test.c index bd73c87..309fc75 100644 --- a/test-opencm3/test.c +++ b/test-opencm3/test.c @@ -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;