@@ -83,7 +83,7 @@ stmpe811_drag_data_t drag_data;
8383point2d_t touch_point ;
8484point2d_t drag_distance ;
8585
86- static inline
86+ static
8787void
8888update_touchscreen_data (void )
8989{
@@ -118,7 +118,7 @@ update_touchscreen_data(void)
118118 }
119119 }
120120}
121- static inline
121+ static
122122void
123123print_touchscreen_data (int16_t x , int16_t y )
124124{
@@ -136,6 +136,9 @@ print_touchscreen_data(int16_t x, int16_t y)
136136 case STMPE811_TOUCH_STATE__TOUCHED_WAITING_FOR_TIMEOUT :
137137 state = "touched waiting" ;
138138 break ;
139+ default :
140+ state = "invalid" ;
141+ break ;
139142 }
140143
141144 sprintf (conv_buf ,
@@ -163,7 +166,7 @@ print_touchscreen_data(int16_t x, int16_t y)
163166#define FROWNY_WIDTH 101
164167#define FROWNY_HEIGHT 121
165168uint16_t frowny [FROWNY_WIDTH * FROWNY_HEIGHT ];
166- static inline void init_floodfill4 (void )
169+ static void init_floodfill4 (void )
167170{
168171 /* init flood-fill (also offscreen rendering demo) */
169172 gfx_offscreen_rendering_begin (frowny , FROWNY_WIDTH , FROWNY_HEIGHT );
@@ -207,9 +210,9 @@ static inline void init_floodfill4(void)
207210 /* resume normal rendering */
208211 gfx_offscreen_rendering_end ();
209212}
210- static inline void draw_floodfill4 (demo_mode_t demo_mode )
213+ static void draw_floodfill4 (demo_mode_t demo_mode )
211214{
212- int16_t x , y ;
215+ int16_t x , y , px , py ;
213216 static int16_t scan_x = -1 , scan_y = -1 ;
214217
215218 switch (demo_mode ) {
@@ -260,8 +263,8 @@ static inline void draw_floodfill4(demo_mode_t demo_mode)
260263 }
261264
262265 /* Worst case dots */
263- for (int16_t px = x + 1 ; px < x + 100 ; px += 4 ) {
264- for (int16_t py = y + 1 ; py < y + 120 ; py += 2 ) {
266+ for (px = x + 1 ; px < x + 100 ; px += 4 ) {
267+ for (py = y + 1 ; py < y + 120 ; py += 2 ) {
265268 gfx_draw_pixel (px , py , GFX_COLOR_GREEN2 );
266269 gfx_draw_pixel (px + 2 , py + 1 , GFX_COLOR_GREEN2 );
267270 }
@@ -295,20 +298,19 @@ static inline void draw_floodfill4(demo_mode_t demo_mode)
295298 * Bezier demonstration
296299 */
297300uint16_t color = GFX_COLOR_BLACK ;
298- void draw_segment (point2d_t p1 , point2d_t p2 );
299- void draw_segment (point2d_t p1 , point2d_t p2 )
301+ static void draw_segment (point2d_t p1 , point2d_t p2 )
300302{
301303 gfx_draw_line (
302304 (int16_t )p1 .x , (int16_t )p1 .y ,
303305 (int16_t )p2 .x , (int16_t )p2 .y ,
304306 color
305307 );
306308}
307- static inline
308- void draw_point_list (point2d_t * points , size_t points_count , uint16_t _color )
309+ static void draw_point_list (point2d_t * points , size_t points_count , uint16_t _color )
309310{
311+ unsigned int i ;
310312 color = _color ;
311- for (size_t i = 0 ; i < points_count - 1 ; i ++ ) {
313+ for (i = 0 ; i < points_count - 1 ; i ++ ) {
312314 draw_segment (points [i ], points [i + 1 ]);
313315 }
314316}
@@ -335,14 +337,14 @@ point2d_t pentagram[] = {
335337};
336338uint32_t num_points ;
337339uint32_t num_ipoints ;
338- static inline void init_bezier (void )
340+ static void init_bezier (void )
339341{
340342 num_points = sizeof (pentagram )/sizeof (pentagram [0 ]);
341- num_ipoints = h2_bezier_calculate_int_points_length (num_points );
343+ num_ipoints = bezier_calculate_int_points_length (num_points );
342344}
343345#define TENSION_MIN 0.15f
344346#define TENSION_MAX 3.0f
345- static inline void draw_bezier (demo_mode_t demo_mode )
347+ static void draw_bezier (demo_mode_t demo_mode )
346348{
347349 switch (demo_mode ) {
348350 case DEMO_MODE_ALL :
@@ -451,9 +453,9 @@ static inline void draw_bezier(demo_mode_t demo_mode)
451453 tension_change = 1 /tension_change ;
452454 }
453455 point2d_t pi1 [num_ipoints ];
454- h2_bezier_cubic (pi1 , pentagram_ , num_points , 0.0001f , tension );
456+ bezier_cubic (pi1 , pentagram_ , num_points , 0.0001f , tension );
455457 for (i = 0 ; i < num_ipoints - 1 ; i += 3 ) {
456- h2_bezier_draw_cubic (
458+ bezier_draw_cubic (
457459 draw_segment ,
458460 15 ,
459461 pi1 [i ],
@@ -468,7 +470,7 @@ static inline void draw_bezier(demo_mode_t demo_mode)
468470 * Bezier interactive demo
469471 */
470472
471- static inline void draw_bezier_interactive (demo_mode_t demo_mode )
473+ static void draw_bezier_interactive (demo_mode_t demo_mode )
472474{
473475 switch (demo_mode ) {
474476 case DEMO_MODE_ALL :
@@ -526,7 +528,7 @@ static inline void draw_bezier_interactive(demo_mode_t demo_mode)
526528
527529 /* draw bezier */
528530 color = GFX_COLOR_RED ;
529- h2_bezier_draw_cubic (
531+ bezier_draw_cubic (
530532 draw_segment ,
531533 20 ,
532534 curve_points [0 ],
@@ -564,7 +566,7 @@ static inline void draw_bezier_interactive(demo_mode_t demo_mode)
564566balls_t ball_simulation ;
565567ball_t balls [100 ];
566568uint64_t ball_timeout ;
567- static inline void init_balls (void )
569+ static void init_balls (void )
568570{
569571 ball_setup (
570572 & ball_simulation ,
@@ -608,9 +610,7 @@ static inline void init_balls(void)
608610
609611 ball_timeout = mtime () + 5000 ;
610612}
611- static inline
612- void
613- draw_balls (demo_mode_t demo_mode )
613+ static void draw_balls (demo_mode_t demo_mode )
614614{
615615 uint64_t ctime = mtime ();
616616 switch (demo_mode ) {
@@ -646,17 +646,16 @@ draw_balls(demo_mode_t demo_mode)
646646/**
647647 * Re-/draw background
648648 */
649- static inline
650- void
651- draw_background (demo_mode_t demo_mode )
649+ static void draw_background (demo_mode_t demo_mode )
652650{
653651 ili9341_set_layer1 ();
654652
655653 gfx_fill_screen (GFX_COLOR_BLACK );
656654
657655 gfx_draw_rect (0 , 0 , gfx_width () , 40 , GFX_COLOR_DARKGREY );
658656 gfx_fill_rect (1 , 1 , gfx_width ()- 2 , 40 - 2 ,
659- ltdc_get_rgb565_from_rgb888 (0x111111 ));
657+ ((0x11 << 11 ) | (0x11 << 5 ) | 0x11 ));
658+ /* ltdc_get_rgb565_from_rgb888(0x111111));*/
660659
661660 gfx_set_font_scale (3 );
662661 gfx_puts2 (10 , 10 , "äLTDC Demo" , & font_Tamsyn5x9b_9 , GFX_COLOR_WHITE );
0 commit comments