This commit is contained in:
JiXieShi
2024-09-21 16:07:31 +08:00
parent 4e53f936d8
commit d2e5789476
27 changed files with 129 additions and 67 deletions

34
sim/Test/sim_test.cpp Normal file
View File

@@ -0,0 +1,34 @@
//
// Created by lydxh on 24-9-21.
//
#include <ctime>
#include <cstdio>
#include <syncstream>
#include "sim_test.h"
void Test_RunTime(char *name, void (*pFunction)(void *)) {
clock_t start, end;
double cpu_time_used;
printf("\n------< %s TEST >------\n", name);
start = clock();
pFunction(NULL);
end = clock();
cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;
printf("\n------< %s END >------\n", name);
printf("\nTime taken by %s: %f seconds\n", name, cpu_time_used);
}
void Test_Run(char *name, void (*pFunction)(void *)) {
printf("\n------< %s TEST >------\n", name);
_beginthread(pFunction, 0, NULL);
}

19
sim/Test/sim_test.h Normal file
View File

@@ -0,0 +1,19 @@
//
// Created by lydxh on 24-9-21.
//
#ifndef HW_LIB_SIM_TEST_H
#define HW_LIB_SIM_TEST_H
/**
* @brief 测试函数执行时间
* @param name: [输入] 测试名称
* @param pFunction: [输入] 指向待测试函数的指针
* @return void
* @example Test("FunctionName", functionName);
**/
void Test_RunTime(char *name, void (*pFunction)(void *));
void Test_Run(char *name, void (*pFunction)(void *));
#endif //HW_LIB_SIM_TEST_H

View File

@@ -24,7 +24,7 @@
*====================*/
/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/
#define LV_COLOR_DEPTH 32
#define LV_COLOR_DEPTH 16
/*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/
#define LV_COLOR_16_SWAP 0

View File

@@ -166,7 +166,7 @@ void colortorgb24(lv_color_t* color_p, uint32_t* color, size_t len)
{
while (len)
{
*color = (uint32_t)RGB(color_p->ch.red, color_p->ch.green, color_p->ch.blue) | (color_p->ch.alpha << 24);
*color = RGB565_to_RGB888(color_p->full, false);
color_p++;
color++;
len--;