Recovery and Charger mode screen rotation 180 degrees [turn]

Source: Internet
Author: User

How to get Recovery (System firmware upgrade),Charger (Power off charge animation) when the screen rotates 180 degrees

Workaround:

1. Find the gr_flip (void) method in the bootable\recovery\minui\graphics.c file

Put memcpy (Gr_framebuffer[gr_active_fb].data,gr_mem_surface.data,

fi.line_length*vi.yres); Revision changed to

rotate_180 (Gr_framebuffer[gr_active_fb].data,gr_mem_surface.data

, fi.line_length*vi.yres);

2. Add a method

void *rotate_180 (void *_dst,const void *_src,int len)

{

int pixelsize = Pixel_size,size,step = number of len/pixelsize;//pixels

unsigned char *dst = _DST;

Const unsigned char *src = _src + len;

while (step--> 0) {

size = Pixelsize;

SRC-=size;

while (size--> 0) {

*dst++ = *src++;

}

SRC-=pixelsize;

}

Return _DST;

}

The function of the rotate_180 method is to reverse the data in buffer by pixels .

Example: Raw data

{(+), (4,5,6), (7,8,9),

(A,b,c), (d,e,f), (G,h,i),

(A,b,c), (d,e,f), (g,h,i)

}

180 degree rotation after data

{(g,h,i), (d,e,f), (A,b,c),

(G,h,i), (d,e,f), (A,b,c),

(7,8,9), (4,5,6), ()

}

The data for each pixel is constant, in pixels, in the order of rotation

This completes the rotation

Recovery and Charger mode screen rotation 180 degrees [turn]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.