Signed-off-by: kevin <kevin@lmve.net>

This commit is contained in:
2022-04-20 18:47:45 +08:00
parent 9669b4d0da
commit 13203a2a21
17 changed files with 966 additions and 866 deletions
+55
View File
@@ -1029,6 +1029,61 @@ void OLED_VL(unsigned char x,unsigned char y,unsigned char size,unsigned char do
}
/*画任意线*/
void OLED_AL(int sx,int sy,int ex,int ey,unsigned char dot_type)
{
int dx,dy;
dx=ex-sx;
dy=ey-sy;
if(dx==0)
{
if(dy>0)
{
for(int y=ey;y>sy;y--)
{
OLED_set_dot(sx,y,dot_type);
}
}
if(dy<0)
{
for(int y=ey;y<sy;y++)
{
OLED_set_dot(sx,y,dot_type);
}
}
return ;
}
if(dy==0)
{
if(dx>0)
{
for(int x=ex;x>sx;x--)
{
OLED_set_dot(x,sy,dot_type);
}
}
if(dx<0)
{
for(int x=ex;x<sx;x++)
{
OLED_set_dot(x,sy,dot_type);
}
}
return ;
}
if(dx==0&&dy==0)
{
//OLED_set_dot(sx,sy,dot_type);
return ;
}
}