@@ -38,7 +38,7 @@ float temperature_on_display = NAN;
3838static bc_ds18b20_t ds18b20 ;
3939
4040int device_index ;
41-
41+ bc_gfx_t * gfx ;
4242
4343struct {
4444 event_param_t temperature ;
@@ -128,6 +128,7 @@ void application_init(void)
128128 bc_led_pulse (& led , 2000 );
129129
130130 bc_module_lcd_init ();
131+ gfx = bc_module_lcd_get_gfx ();
131132
132133 //bc_log_init(BC_LOG_LEVEL_DEBUG, BC_LOG_TIMESTAMP_ABS);
133134 bc_scheduler_plan_from_now (0 , 1000 );
@@ -144,18 +145,14 @@ void application_task(void)
144145
145146 bc_system_pll_enable ();
146147
147- bc_module_lcd_clear ();
148-
149- bc_module_lcd_set_font (& bc_font_ubuntu_33 );
150- snprintf (str_temperature , sizeof (str_temperature ), "%.1f " , params .temperature_ds18b20 .value );
151- int x = bc_module_lcd_draw_string (20 , 20 , str_temperature , true);
152- temperature_on_display = params .temperature_ds18b20 .value ;
148+ bc_gfx_clear (gfx );
149+ bc_gfx_set_font (gfx , & bc_font_ubuntu_33 );
150+ int x = bc_gfx_printf (gfx , 20 ,20 , 1 , "%.1f " , temperature_on_display );
153151
154152 bc_module_lcd_set_font (& bc_font_ubuntu_24 );
155- bc_module_lcd_draw_string ( x - 20 , 25 , "\xb0" "C " , true );
153+ bc_gfx_draw_string ( gfx , x - 20 , 25 , "\xb0" "C " , 1 );
156154
157- bc_module_lcd_update ( );
155+ bc_gfx_update ( gfx );
158156
159157 bc_system_pll_disable ();
160-
161158}
0 commit comments