MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / drawarea

Function drawarea

bsp/k210/drivers/test/lcd_test.c:7–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include "drv_lcd.h"
6
7static 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
35static int showcolor(int argc, char **argv)
36{

Callers 1

showcolorFunction · 0.85

Calls 1

rt_device_controlFunction · 0.85

Tested by

no test coverage detected