aboutsummaryrefslogtreecommitdiff
path: root/tests/unity/unity_support.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unity/unity_support.c')
-rw-r--r--tests/unity/unity_support.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/unity/unity_support.c b/tests/unity/unity_support.c
index 0c32ddc78..4492bbb44 100644
--- a/tests/unity/unity_support.c
+++ b/tests/unity/unity_support.c
@@ -461,6 +461,28 @@ static void buf_to_xrgb8888(const uint8_t * buf_in, uint8_t * buf_out, lv_color_
buf_out += 800 * 4;
}
}
+ else if (cf_in == LV_COLOR_FORMAT_I1)
+ {
+ uint32_t y;
+ for (y = 0; y < 480; y++)
+ {
+ uint32_t x;
+ for (x = 0; x < 800; x++)
+ {
+ const uint8_t byte = buf_in[x / 8];
+ const uint8_t bit_pos = x % 8;
+ const uint8_t pixel = (byte >> (7 - bit_pos)) & 0x01;
+
+ buf_out[x * 4 + 3] = 0xff;
+ buf_out[x * 4 + 2] = pixel ? 0xff : 0x00;
+ buf_out[x * 4 + 1] = pixel ? 0xff : 0x00;
+ buf_out[x * 4 + 0] = pixel ? 0xff : 0x00;
+ }
+
+ buf_in += stride;
+ buf_out += 800 * 4;
+ }
+ }
}
static void create_folders_if_needed(const char * path)