md(git back) for暴力涂色

This commit is contained in:
james 2024-08-04 17:25:03 +08:00
parent 1c7ba7dd86
commit 6615870145
2 changed files with 14 additions and 5 deletions

View File

@ -31,6 +31,10 @@ git remote remove origin
git remote set-url --add origin git@github.com:*.git
git push -u origin master
# 退到/进到 指定commit的sha码
git reset --hard dde8c25694f34acf8971f0782b1a676f39bf0a46
```
## SConscript
加入这个文件可以使在当前文件夹里的也能被调用

View File

@ -14,17 +14,22 @@ void lcd_white(int x, int y)
{
lcd_address_set(x, y, x, y);
lcd_write_half_word(WHITE);
}
void snake_address(int x, int y,int r,const rt_uint16_t da)
void snake_address(int x, int y, int r, const rt_uint16_t da)
{
lcd_fill(x*r, y*r, x*r+r-1, y*r+r-1,da);
lcd_write_half_word(da);
for (int i = x * r; i < x * r + r; i++)
{
for (int j = y * r; j < y * r + r; j++)
{
lcd_address_set(i, j, i, j);
lcd_write_half_word(da);
}
}
}
// bt 命令行
int color_cmd(int argc, char **argv)
{
snake_address(atoi(argv[1]), atoi(argv[2]), atoi(argv[3]),BLACK);
snake_address(atoi(argv[1]), atoi(argv[2]), atoi(argv[3]), BLACK);
return 1;
}
MSH_CMD_EXPORT_ALIAS(color_cmd, snk, bt );