@@ -83,7 +83,7 @@ stmpe811_drag_data_t drag_data;
83
83
point2d_t touch_point ;
84
84
point2d_t drag_distance ;
85
85
86
- static inline
86
+ static
87
87
void
88
88
update_touchscreen_data (void )
89
89
{
@@ -118,7 +118,7 @@ update_touchscreen_data(void)
118
118
}
119
119
}
120
120
}
121
- static inline
121
+ static
122
122
void
123
123
print_touchscreen_data (int16_t x , int16_t y )
124
124
{
@@ -136,6 +136,9 @@ print_touchscreen_data(int16_t x, int16_t y)
136
136
case STMPE811_TOUCH_STATE__TOUCHED_WAITING_FOR_TIMEOUT :
137
137
state = "touched waiting" ;
138
138
break ;
139
+ default :
140
+ state = "invalid" ;
141
+ break ;
139
142
}
140
143
141
144
sprintf (conv_buf ,
@@ -163,7 +166,7 @@ print_touchscreen_data(int16_t x, int16_t y)
163
166
#define FROWNY_WIDTH 101
164
167
#define FROWNY_HEIGHT 121
165
168
uint16_t frowny [FROWNY_WIDTH * FROWNY_HEIGHT ];
166
- static inline void init_floodfill4 (void )
169
+ static void init_floodfill4 (void )
167
170
{
168
171
/* init flood-fill (also offscreen rendering demo) */
169
172
gfx_offscreen_rendering_begin (frowny , FROWNY_WIDTH , FROWNY_HEIGHT );
@@ -207,9 +210,9 @@ static inline void init_floodfill4(void)
207
210
/* resume normal rendering */
208
211
gfx_offscreen_rendering_end ();
209
212
}
210
- static inline void draw_floodfill4 (demo_mode_t demo_mode )
213
+ static void draw_floodfill4 (demo_mode_t demo_mode )
211
214
{
212
- int16_t x , y ;
215
+ int16_t x , y , px , py ;
213
216
static int16_t scan_x = -1 , scan_y = -1 ;
214
217
215
218
switch (demo_mode ) {
@@ -260,8 +263,8 @@ static inline void draw_floodfill4(demo_mode_t demo_mode)
260
263
}
261
264
262
265
/* 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 ) {
265
268
gfx_draw_pixel (px , py , GFX_COLOR_GREEN2 );
266
269
gfx_draw_pixel (px + 2 , py + 1 , GFX_COLOR_GREEN2 );
267
270
}
@@ -295,20 +298,19 @@ static inline void draw_floodfill4(demo_mode_t demo_mode)
295
298
* Bezier demonstration
296
299
*/
297
300
uint16_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 )
300
302
{
301
303
gfx_draw_line (
302
304
(int16_t )p1 .x , (int16_t )p1 .y ,
303
305
(int16_t )p2 .x , (int16_t )p2 .y ,
304
306
color
305
307
);
306
308
}
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 )
309
310
{
311
+ unsigned int i ;
310
312
color = _color ;
311
- for (size_t i = 0 ; i < points_count - 1 ; i ++ ) {
313
+ for (i = 0 ; i < points_count - 1 ; i ++ ) {
312
314
draw_segment (points [i ], points [i + 1 ]);
313
315
}
314
316
}
@@ -335,14 +337,14 @@ point2d_t pentagram[] = {
335
337
};
336
338
uint32_t num_points ;
337
339
uint32_t num_ipoints ;
338
- static inline void init_bezier (void )
340
+ static void init_bezier (void )
339
341
{
340
342
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 );
342
344
}
343
345
#define TENSION_MIN 0.15f
344
346
#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 )
346
348
{
347
349
switch (demo_mode ) {
348
350
case DEMO_MODE_ALL :
@@ -451,9 +453,9 @@ static inline void draw_bezier(demo_mode_t demo_mode)
451
453
tension_change = 1 /tension_change ;
452
454
}
453
455
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 );
455
457
for (i = 0 ; i < num_ipoints - 1 ; i += 3 ) {
456
- h2_bezier_draw_cubic (
458
+ bezier_draw_cubic (
457
459
draw_segment ,
458
460
15 ,
459
461
pi1 [i ],
@@ -468,7 +470,7 @@ static inline void draw_bezier(demo_mode_t demo_mode)
468
470
* Bezier interactive demo
469
471
*/
470
472
471
- static inline void draw_bezier_interactive (demo_mode_t demo_mode )
473
+ static void draw_bezier_interactive (demo_mode_t demo_mode )
472
474
{
473
475
switch (demo_mode ) {
474
476
case DEMO_MODE_ALL :
@@ -526,7 +528,7 @@ static inline void draw_bezier_interactive(demo_mode_t demo_mode)
526
528
527
529
/* draw bezier */
528
530
color = GFX_COLOR_RED ;
529
- h2_bezier_draw_cubic (
531
+ bezier_draw_cubic (
530
532
draw_segment ,
531
533
20 ,
532
534
curve_points [0 ],
@@ -564,7 +566,7 @@ static inline void draw_bezier_interactive(demo_mode_t demo_mode)
564
566
balls_t ball_simulation ;
565
567
ball_t balls [100 ];
566
568
uint64_t ball_timeout ;
567
- static inline void init_balls (void )
569
+ static void init_balls (void )
568
570
{
569
571
ball_setup (
570
572
& ball_simulation ,
@@ -608,9 +610,7 @@ static inline void init_balls(void)
608
610
609
611
ball_timeout = mtime () + 5000 ;
610
612
}
611
- static inline
612
- void
613
- draw_balls (demo_mode_t demo_mode )
613
+ static void draw_balls (demo_mode_t demo_mode )
614
614
{
615
615
uint64_t ctime = mtime ();
616
616
switch (demo_mode ) {
@@ -646,17 +646,16 @@ draw_balls(demo_mode_t demo_mode)
646
646
/**
647
647
* Re-/draw background
648
648
*/
649
- static inline
650
- void
651
- draw_background (demo_mode_t demo_mode )
649
+ static void draw_background (demo_mode_t demo_mode )
652
650
{
653
651
ili9341_set_layer1 ();
654
652
655
653
gfx_fill_screen (GFX_COLOR_BLACK );
656
654
657
655
gfx_draw_rect (0 , 0 , gfx_width () , 40 , GFX_COLOR_DARKGREY );
658
656
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));*/
660
659
661
660
gfx_set_font_scale (3 );
662
661
gfx_puts2 (10 , 10 , "äLTDC Demo" , & font_Tamsyn5x9b_9 , GFX_COLOR_WHITE );
0 commit comments