1.1 --- a/stage2/example.c Sun Apr 24 16:19:49 2016 +0200
1.2 +++ b/stage2/example.c Sun Apr 24 17:06:08 2016 +0200
1.3 @@ -35,15 +35,24 @@
1.4 }
1.5 }
1.6
1.7 +void plot_value(u32 value)
1.8 +{
1.9 + unsigned short x, y;
1.10 + for (y = 0; y < panel_info.vl_row; y++)
1.11 + {
1.12 + for (x = 0; x < panel_info.vl_col; x++)
1.13 + {
1.14 + set_pixel(x, y, get_bitmap_value(x, value));
1.15 + }
1.16 + }
1.17 +}
1.18 +
1.19 /* Tasks. */
1.20
1.21 void plot_pattern(unsigned short pixel_type, unsigned short x, unsigned short y)
1.22 {
1.23 while (1) {
1.24 - if (pixel_type)
1.25 - test_pixel(x, y, pixel_type);
1.26 - else
1.27 - clear_pixel(x, y);
1.28 + test_pixel(x, y, pixel_type);
1.29 next_pixel(&x, &y);
1.30 udelay(100);
1.31 }
1.32 @@ -51,7 +60,7 @@
1.33
1.34 void start_plot_pattern(unsigned short task)
1.35 {
1.36 - u32 args[] = {task, 0, (task - 1) * 60};
1.37 + u32 args[] = {task, 0, ((task - 1) * (panel_info.vl_row / 4)) % panel_info.vl_row};
1.38
1.39 start_task(task, (void (*)()) plot_pattern, args, 3);
1.40 }
2.1 --- a/stage2/lcd.c Sun Apr 24 16:19:49 2016 +0200
2.2 +++ b/stage2/lcd.c Sun Apr 24 17:06:08 2016 +0200
2.3 @@ -63,6 +63,11 @@
2.4 return (div(r, 255, rmax) << rshift) | (div(g, 255, gmax) << gshift) | (div(b, 255, bmax) << bshift);
2.5 }
2.6
2.7 +u32 get_bitmap_value(unsigned short x, u32 value)
2.8 +{
2.9 + return (value >> (((panel_info.vl_col - 1 - x) * 32) / panel_info.vl_col)) % 2 ? 0xffffffff : 0;
2.10 +}
2.11 +
2.12 static void get_colour(unsigned short h, unsigned short v, u8 rgb[], unsigned short pixel_type)
2.13 {
2.14 unsigned short v_max = panel_info.vl_row;
2.15 @@ -125,7 +130,7 @@
2.16 u8 rgb[3];
2.17
2.18 get_colour(h, v, rgb, pixel_type);
2.19 - set_pixel32(h, v, pixel(rgb[0], rgb[1], rgb[2], 255, 255, 255, 16, 8, 0));
2.20 + set_pixel32(h, v, pixel(rgb[0], rgb[1], rgb[2], 255, 255, 255, 16, 8, 0) | get_bitmap_value(h, pixel_type));
2.21 }
2.22
2.23 static void test_pixel16_565(unsigned short h, unsigned short v, unsigned short pixel_type)
2.24 @@ -133,7 +138,7 @@
2.25 u8 rgb[3];
2.26
2.27 get_colour(h, v, rgb, pixel_type);
2.28 - set_pixel16_565(h, v, pixel(rgb[0], rgb[1], rgb[2], 31, 63, 31, 11, 5, 0));
2.29 + set_pixel16_565(h, v, pixel(rgb[0], rgb[1], rgb[2], 31, 63, 31, 11, 5, 0) | get_bitmap_value(h, pixel_type));
2.30 }
2.31
2.32 static void test_pixel8(unsigned short h, unsigned short v, unsigned short pixel_type)
2.33 @@ -141,7 +146,7 @@
2.34 u8 rgb[3];
2.35
2.36 get_colour(h, v, rgb, pixel_type);
2.37 - set_pixel8(h, v, pixel(rgb[0], rgb[1], rgb[2], 7, 7, 3, 5, 2, 0));
2.38 + set_pixel8(h, v, pixel(rgb[0], rgb[1], rgb[2], 7, 7, 3, 5, 2, 0) | get_bitmap_value(h, pixel_type));
2.39 }
2.40
2.41 static void test_pixel4(unsigned short h, unsigned short v, unsigned short pixel_type)
2.42 @@ -149,7 +154,7 @@
2.43 u8 rgb[3];
2.44
2.45 get_colour(h, v, rgb, pixel_type);
2.46 - set_pixel4(h, v, pixel(rgb[0], rgb[1], rgb[2], 1, 2, 1, 3, 1, 0));
2.47 + set_pixel4(h, v, pixel(rgb[0], rgb[1], rgb[2], 1, 2, 1, 3, 1, 0) | get_bitmap_value(h, pixel_type));
2.48 }
2.49
2.50 void test_pixel(unsigned short h, unsigned short v, unsigned short pixel_type)