Skip to content

Commit abc2c59

Browse files
GuEe-GUIRbb666
authored andcommitted
style: format code with clang-format
1 parent 871d9f5 commit abc2c59

4 files changed

Lines changed: 146 additions & 144 deletions

File tree

components/drivers/graphic/graphic.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static rt_err_t plane_fb_pan_display(struct rt_graphic_plane *plane,
123123
}
124124

125125
offset = rect->y * plane->line_length + rect->x * byte_per_pixel;
126-
span = (rect->height - 1) * plane->line_length + row_bytes;
126+
span = (rect->height - 1) * plane->line_length + row_bytes;
127127

128128
if (offset <= plane->framebuffer_len && span <= plane->framebuffer_len - offset)
129129
{
@@ -214,7 +214,7 @@ static rt_err_t _graphic_control(rt_device_t dev, int cmd, void *args)
214214
{
215215
rt_err_t err = RT_EOK;
216216
rt_bool_t need_schedule = RT_FALSE;
217-
rt_bool_t wait_vsync = RT_FALSE;
217+
rt_bool_t wait_vsync = RT_FALSE;
218218
struct rt_graphic_device *gdev = raw_to_graphic(dev);
219219

220220
_retry:
@@ -567,8 +567,8 @@ static rt_err_t _graphic_control(rt_device_t dev, int cmd, void *args)
567567
var->yres = plane->height;
568568
var->xres_virtual = plane->width;
569569
var->yres_virtual = plane->height * (plane->framebuffer_len / plane->screen_len);
570-
var->xoffset = plane->x;
571-
var->yoffset = plane->y;
570+
var->xoffset = plane->x;
571+
var->yoffset = plane->y;
572572
var->bits_per_pixel = plane->bits_per_pixel;
573573

574574
if (plane == gdev->primary_plane)

components/drivers/include/drivers/lcd.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
#define FBIO_WAITFORVSYNC 0x4620
4242

4343
/* fb_var_screeninfo.activate */
44-
#define FB_ACTIVATE_NOW 0
45-
#define FB_ACTIVATE_NXTOPEN 1
46-
#define FB_ACTIVATE_TEST 2
47-
#define FB_ACTIVATE_MASK 15
48-
#define FB_ACTIVATE_VBL 16
49-
#define FB_ACTIVATE_ALL 64
50-
#define FB_ACTIVATE_FORCE 128
44+
#define FB_ACTIVATE_NOW 0
45+
#define FB_ACTIVATE_NXTOPEN 1
46+
#define FB_ACTIVATE_TEST 2
47+
#define FB_ACTIVATE_MASK 15
48+
#define FB_ACTIVATE_VBL 16
49+
#define FB_ACTIVATE_ALL 64
50+
#define FB_ACTIVATE_FORCE 128
5151

5252
struct fb_bitfield
5353
{

examples/test/dm_graphic_test.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ rt_err_t graphic_start(const char *gdev, int count)
226226
{
227227
rt_err_t err;
228228
rt_uint8_t *vfb, *fb, *pixel, bpp;
229-
rt_size_t frame_len, page_count, front_page;
230-
struct rt_device_rect_info rect;
229+
rt_size_t frame_len, page_count, front_page;
230+
struct rt_device_rect_info rect;
231231
struct rt_device_graphic_info info;
232-
struct fb_var_screeninfo var;
232+
struct fb_var_screeninfo var;
233233
struct rt_device *dev = rt_device_find(gdev);
234234
void (*conv_func)(rt_uint8_t r, rt_uint8_t g, rt_uint8_t b, void *pixel);
235235

@@ -253,7 +253,7 @@ rt_err_t graphic_start(const char *gdev, int count)
253253
goto _end;
254254
}
255255

256-
frame_len = (rt_size_t)info.pitch * info.height;
256+
frame_len = (rt_size_t)info.pitch * info.height;
257257
page_count = frame_len ? info.smem_len / frame_len : 0;
258258

259259
if (!page_count)
@@ -310,21 +310,21 @@ rt_err_t graphic_start(const char *gdev, int count)
310310
{
311311
front_page = (front_page + 1) % page_count;
312312
rt_memcpy((rt_uint8_t *)info.framebuffer + front_page * frame_len,
313-
vfb, frame_len);
313+
vfb, frame_len);
314314

315-
var.xoffset = 0;
316-
var.yoffset = front_page * info.height;
315+
var.xoffset = 0;
316+
var.yoffset = front_page * info.height;
317317
var.activate = FB_ACTIVATE_VBL;
318-
err = rt_device_control(dev, FBIOPAN_DISPLAY, &var);
318+
err = rt_device_control(dev, FBIOPAN_DISPLAY, &var);
319319
}
320320
else
321321
{
322322
rt_memcpy(info.framebuffer, vfb, frame_len);
323-
rect.x = 0;
324-
rect.y = 0;
325-
rect.width = info.width;
323+
rect.x = 0;
324+
rect.y = 0;
325+
rect.width = info.width;
326326
rect.height = info.height;
327-
err = rt_device_control(dev, RTGRAPHIC_CTRL_RECT_UPDATE, &rect);
327+
err = rt_device_control(dev, RTGRAPHIC_CTRL_RECT_UPDATE, &rect);
328328

329329
if (!err)
330330
{

0 commit comments

Comments
 (0)