91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 4KB
    文件類型: .c
    金幣: 1
    下載: 1 次
    發布日期: 2021-05-15
  • 語言: 其他
  • 標簽: LCD控制??

資源簡介

基于嵌入式linux系統下的畫板小程序,可以實現畫板的顯示以及畫筆的切換,單線程操作,可以清空畫板。

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?

#include?

void?show_color_q(int?locat1int?locat2int?sizexint?sizeyint?colorchar?*p);
void?show_inite(char?*p);
void?double_dot(int?xint?ychar?*p);//顯示點的函數
void?show_line(int?x1int?y1int?x2int?y2char?*p);

int?main(void)
{
int?lcd?=?open(“/dev/fb0“O_RDWR);
int?fd?=?open(“/dev/input/event0“O_RDONLY);
struct?input_event?buf;

if(lcd?==?-1)
{
perror(“開啟LCD失敗“);
exit(0);
}

char?*p?=?mmap(NULL800*480*4PROT_READ?|?PROT_WRITEMAP_SHAREDlcd0);
int32_t?c0?=?0x00ed1c24;
int32_t?c1?=?0x00fff300;
int32_t?c2?=?0x0022b14c;
int32_t?c3?=?0x00b97a56;
int32_t?c4?=?0x0099d9eb;
int32_t?c5?=?0x00000000;
int32_t?c6?=?0x003e48cd;
int32_t?c7?=?0x00a348a5;
int32_t?colors[]={c0c1c2c3c4c5c6c7};

show_inite(p);
bool?xdone?=?false;
bool?ydone?=?true;
bool?x1done?=?false;
bool?y1done?=?true;
bool?charge?=?false;
int?a=1000b=1000a1=1000b1=1000;

while(1)
{
bzero(&bufsizeof(buf));
read(fd&bufsizeof(buf));

if(buf.type?==?EV_ABS)
{
if(buf.code?==?ABS_X&&ydone==true&&charge==false)
{
a=buf.value;
xdone?=?true;
ydone?=?false;
}
else?if(buf.code?==?ABS_Y&&xdone?==true&&charge==false)
{
b=buf.value;
ydone?=?true;
xdone?=?false;
charge?=?true;
if(a<=20&&b<=20)
show_inite(p);
if(a1<798&&b1<478)
show_line(a1b1abp);
}
else?if(buf.code?==?ABS_X&&y1done==true&&charge?==?true)
{
a1=buf.value;
x1done?=?true;
y1done?=?false;

評論

共有 條評論