| 5 | #include "drv_lcd.h" |
| 6 | |
| 7 | static void drawarea(rt_device_t dev, struct rt_device_graphic_info *info, |
| 8 | int x, int y, int w, int h, uint16_t c) |
| 9 | { |
| 10 | struct rt_device_rect_info rect; |
| 11 | uint16_t *fb; |
| 12 | int i, j; |
| 13 | |
| 14 | fb = (uint16_t *)info->framebuffer; |
| 15 | fb += (info->width * y); |
| 16 | fb += x; |
| 17 | |
| 18 | for (j = 0; j < h; j++) |
| 19 | { |
| 20 | for (i = 0; i < w; i++) |
| 21 | { |
| 22 | fb[i] = c; |
| 23 | } |
| 24 | fb += info->width; |
| 25 | } |
| 26 | |
| 27 | rect.x = x; |
| 28 | rect.y = y; |
| 29 | rect.width = w; |
| 30 | rect.height = h; |
| 31 | |
| 32 | rt_device_control(dev, RTGRAPHIC_CTRL_RECT_UPDATE, &rect); |
| 33 | } |
| 34 | |
| 35 | static int showcolor(int argc, char **argv) |
| 36 | { |
no test coverage detected