写入一个脚本来测试屏幕,发现屏幕的颜色与预取不一致.
全志的framebuffer应该32位,按如下的方式写入,应该是红色,但实际上是紫色
yes "$(printf "\x00\x00\x00\xFF")" | head -c 16588800 > test.bin && dd if=test.bin of=/dev/fb0
按如下方式,屏幕也是显示紫色
yes "$(printf "\x00\x00\xff\x00")" | head -c 16588800 > test.bin && dd if=test.bin of=/dev/fb0
yes "$(printf "\x00\x00\x00\xff")" | head -c 16588800 > test.bin && dd if=test.bin of=/dev/fb0
下面写入黑色是正确的
yes "$(printf "\x00\x00\x00\x00")" | head -c 16588800 > test.bin && dd if=test.bin of=/dev/fb0
下面写入白色是正确
yes "$(printf "\x00\xff\xff\xff")" | head -c 16588800 > test.bin && dd if=test.bin of=/dev/fb0
这是什么原因,难道全志的framebuffer不是ARGB的格式吗?
离线
上面这个脚本我是用ai来生成的,是有问题的. head会加入回车符,并导致00数据丢失.
还是上面的脚本有问题
离线