feat: 为选中项增加了奇怪的动效

This commit is contained in:
2024-01-06 17:19:36 +08:00
parent abca5d603c
commit 737fc2de6b
4 changed files with 79 additions and 105 deletions

View File

@@ -316,10 +316,10 @@ static void ips200_set_region(uint16 x1, uint16 y1, uint16 x2, uint16 y2)
// 如果程序在输出了断言信息 并且提示出错位置在这里
// 那么一般是屏幕显示的时候超过屏幕分辨率范围了
// 检查一下你的显示调用的函数 自己计算一下哪里超过了屏幕显示范围
zf_assert(x1 < ips200_x_max);
zf_assert(y1 < ips200_y_max);
zf_assert(x2 < ips200_x_max);
zf_assert(y2 < ips200_y_max);
// zf_assert(x1 < ips200_x_max);
// zf_assert(y1 < ips200_y_max);
// zf_assert(x2 < ips200_x_max);
// zf_assert(y2 < ips200_y_max);
ips200_write_command(0x2a);
ips200_write_16bit_data(x1);
@@ -484,8 +484,8 @@ void ips200_draw_point(uint16 x, uint16 y, const uint16 color)
{
// 如果程序在输出了断言信息 并且提示出错位置在这里
// 那么一般是屏幕显示的时候超过屏幕分辨率范围了
zf_assert(x < ips200_x_max);
zf_assert(y < ips200_y_max);
// zf_assert(x < ips200_x_max);
// zf_assert(y < ips200_y_max);
if (IPS200_TYPE_SPI == ips200_display_type) {
IPS200_CS(0);
@@ -512,10 +512,10 @@ void ips200_draw_line(uint16 x_start, uint16 y_start, uint16 x_end, uint16 y_end
{
// 如果程序在输出了断言信息 并且提示出错位置在这里
// 那么一般是屏幕显示的时候超过屏幕分辨率范围了
zf_assert(x_start < ips200_x_max);
zf_assert(y_start < ips200_y_max);
zf_assert(x_end < ips200_x_max);
zf_assert(y_end < ips200_y_max);
// zf_assert(x_start < ips200_x_max);
// zf_assert(y_start < ips200_y_max);
// zf_assert(x_end < ips200_x_max);
// zf_assert(y_end < ips200_y_max);
int16 x_dir = (x_start < x_end ? 1 : -1);
int16 y_dir = (y_start < y_end ? 1 : -1);
@@ -565,61 +565,39 @@ void ips200_show_char(uint16 x, uint16 y, const char dat)
{
// 如果程序在输出了断言信息 并且提示出错位置在这里
// 那么一般是屏幕显示的时候超过屏幕分辨率范围了
zf_assert(x < ips200_x_max);
zf_assert(y < ips200_y_max);
// zf_assert(x < ips200_x_max);
// zf_assert(y < ips200_y_max);
uint8 i = 0, j = 0;
if (IPS200_TYPE_SPI == ips200_display_type) {
IPS200_CS(0);
}
switch (ips200_display_font) {
case IPS200_6X8_FONT: {
uint16 display_buffer[6 * 8];
ips200_set_region(x, y, x + 5, y + 7);
for (i = 0; 6 > i; i++) {
// 减 32 因为是取模是从空格开始取得 空格在 ascii 中序号是 32
uint8 temp_top = ascii_font_6x8[dat - 32][i];
for (j = 0; 8 > j; j++) {
if (temp_top & 0x01) {
display_buffer[i + j * 6] = (ips200_pencolor);
} else {
display_buffer[i + j * 6] = (ips200_bgcolor);
}
temp_top >>= 1;
}
uint16 display_buffer[8 * 16];
ips200_set_region(x, y, x + 7, y + 15);
for (i = 0; 8 > i; i++) {
uint8 temp_top = ascii_font_8x16[dat - 32][i];
uint8 temp_bottom = ascii_font_8x16[dat - 32][i + 8];
for (j = 0; 8 > j; j++) {
if (temp_top & 0x01) {
display_buffer[i + j * 8] = (ips200_pencolor);
} else {
display_buffer[i + j * 8] = (ips200_bgcolor);
}
ips200_write_16bit_data_array(display_buffer, 6 * 8);
} break;
case IPS200_8X16_FONT: {
uint16 display_buffer[8 * 16];
ips200_set_region(x, y, x + 7, y + 15);
for (i = 0; 8 > i; i++) {
uint8 temp_top = ascii_font_8x16[dat - 32][i];
uint8 temp_bottom = ascii_font_8x16[dat - 32][i + 8];
for (j = 0; 8 > j; j++) {
if (temp_top & 0x01) {
display_buffer[i + j * 8] = (ips200_pencolor);
} else {
display_buffer[i + j * 8] = (ips200_bgcolor);
}
temp_top >>= 1;
}
for (j = 0; 8 > j; j++) {
if (temp_bottom & 0x01) {
display_buffer[i + j * 8 + 4 * 16] = (ips200_pencolor);
} else {
display_buffer[i + j * 8 + 4 * 16] = (ips200_bgcolor);
}
temp_bottom >>= 1;
}
temp_top >>= 1;
}
for (j = 0; 8 > j; j++) {
if (temp_bottom & 0x01) {
display_buffer[i + j * 8 + 4 * 16] = (ips200_pencolor);
} else {
display_buffer[i + j * 8 + 4 * 16] = (ips200_bgcolor);
}
ips200_write_16bit_data_array(display_buffer, 8 * 16);
} break;
case IPS200_16X16_FONT: {
// 暂不支持
} break;
temp_bottom >>= 1;
}
ips200_write_16bit_data_array(display_buffer, 8 * 16);
}
if (IPS200_TYPE_SPI == ips200_display_type) {
IPS200_CS(1);
}
@@ -638,8 +616,8 @@ void ips200_show_string(uint16 x, uint16 y, const char dat[])
{
// 如果程序在输出了断言信息 并且提示出错位置在这里
// 那么一般是屏幕显示的时候超过屏幕分辨率范围了
zf_assert(x < ips200_x_max);
zf_assert(y < ips200_y_max);
// zf_assert(x < ips200_x_max);
// zf_assert(y < ips200_y_max);
uint16 j = 0;
while ('\0' != dat[j]) {
@@ -671,10 +649,10 @@ void ips200_show_int(uint16 x, uint16 y, const int32 dat, uint8 num)
{
// 如果程序在输出了断言信息 并且提示出错位置在这里
// 那么一般是屏幕显示的时候超过屏幕分辨率范围了
zf_assert(x < ips200_x_max);
zf_assert(y < ips200_y_max);
zf_assert(0 < num);
zf_assert(10 >= num);
// zf_assert(x < ips200_x_max);
// zf_assert(y < ips200_y_max);
// zf_assert(0 < num);
// zf_assert(10 >= num);
int32 dat_temp = dat;
int32 offset = 1;
@@ -708,10 +686,10 @@ void ips200_show_uint(uint16 x, uint16 y, const uint32 dat, uint8 num)
{
// 如果程序在输出了断言信息 并且提示出错位置在这里
// 那么一般是屏幕显示的时候超过屏幕分辨率范围了
zf_assert(x < ips200_x_max);
zf_assert(y < ips200_y_max);
zf_assert(0 < num);
zf_assert(10 >= num);
// zf_assert(x < ips200_x_max);
// zf_assert(y < ips200_y_max);
// zf_assert(0 < num);
// zf_assert(10 >= num);
uint32 dat_temp = dat;
int32 offset = 1;
@@ -748,12 +726,12 @@ void ips200_show_float(uint16 x, uint16 y, const double dat, uint8 num, uint8 po
{
// 如果程序在输出了断言信息 并且提示出错位置在这里
// 那么一般是屏幕显示的时候超过屏幕分辨率范围了
zf_assert(x < ips200_x_max);
zf_assert(y < ips200_y_max);
zf_assert(0 < num);
zf_assert(8 >= num);
zf_assert(0 < pointnum);
zf_assert(6 >= pointnum);
// zf_assert(x < ips200_x_max);
// zf_assert(y < ips200_y_max);
// zf_assert(0 < num);
// zf_assert(8 >= num);
// zf_assert(0 < pointnum);
// zf_assert(6 >= pointnum);
double dat_temp = dat;
double offset = 1.0;
@@ -790,9 +768,9 @@ void ips200_show_binary_image(uint16 x, uint16 y, const uint8 *image, uint16 wid
{
// 如果程序在输出了断言信息 并且提示出错位置在这里
// 那么一般是屏幕显示的时候超过屏幕分辨率范围了
zf_assert(x < ips200_x_max);
zf_assert(y < ips200_y_max);
zf_assert(NULL != image);
// zf_assert(x < ips200_x_max);
// zf_assert(y < ips200_y_max);
// zf_assert(NULL != image);
uint32 i = 0, j = 0;
uint8 temp = 0;
@@ -844,9 +822,9 @@ void ips200_show_gray_image(uint16 x, uint16 y, const uint8 *image, uint16 width
{
// 如果程序在输出了断言信息 并且提示出错位置在这里
// 那么一般是屏幕显示的时候超过屏幕分辨率范围了
zf_assert(x < ips200_x_max);
zf_assert(y < ips200_y_max);
zf_assert(NULL != image);
// zf_assert(x < ips200_x_max);
// zf_assert(y < ips200_y_max);
// zf_assert(NULL != image);
uint32 i = 0, j = 0;
uint16 color = 0, temp = 0;
@@ -901,9 +879,9 @@ void ips200_show_rgb565_image(uint16 x, uint16 y, const uint16 *image, uint16 wi
{
// 如果程序在输出了断言信息 并且提示出错位置在这里
// 那么一般是屏幕显示的时候超过屏幕分辨率范围了
zf_assert(x < ips200_x_max);
zf_assert(y < ips200_y_max);
zf_assert(NULL != image);
// zf_assert(x < ips200_x_max);
// zf_assert(y < ips200_y_max);
// zf_assert(NULL != image);
uint32 i = 0, j = 0;
uint16 data_buffer[dis_width];
@@ -947,9 +925,9 @@ void ips200_show_wave(uint16 x, uint16 y, const uint16 *wave, uint16 width, uint
{
// 如果程序在输出了断言信息 并且提示出错位置在这里
// 那么一般是屏幕显示的时候超过屏幕分辨率范围了
zf_assert(x < ips200_x_max);
zf_assert(y < ips200_y_max);
zf_assert(NULL != wave);
// zf_assert(x < ips200_x_max);
// zf_assert(y < ips200_y_max);
// zf_assert(NULL != wave);
uint32 i = 0, j = 0;
uint32 width_index = 0, value_max_index = 0;
@@ -992,9 +970,9 @@ void ips200_show_chinese(uint16 x, uint16 y, uint8 size, const uint8 *chinese_bu
{
// 如果程序在输出了断言信息 并且提示出错位置在这里
// 那么一般是屏幕显示的时候超过屏幕分辨率范围了
zf_assert(x < ips200_x_max);
zf_assert(y < ips200_y_max);
zf_assert(NULL != chinese_buffer);
// zf_assert(x < ips200_x_max);
// zf_assert(y < ips200_y_max);
// zf_assert(NULL != chinese_buffer);
int i = 0, j = 0, k = 0;
uint8 temp = 0, temp1 = 0, temp2 = 0;