This commit is contained in:
JiXieShi
2024-09-21 23:07:22 +08:00
parent 6c9a999c71
commit 8f7f72712c
27 changed files with 100 additions and 81 deletions

View File

@@ -5,6 +5,6 @@
#ifndef HW_LIB_T_ARG_H
#define HW_LIB_T_ARG_H
void Test_argpase(void *pVoid);
int Test_argpase(void *pVoid);
#endif //HW_LIB_T_ARG_H

View File

@@ -11,7 +11,7 @@ Option Opts[6] = {{"T0", T0},
{"T4", T4},
{"T5", T5}};
void Test_argpase(void *pVoid) {
int Test_argpase(void *pVoid) {
OptList *Head = Options_Creat("Head", -1);
OptList *t;
int i;

View File

@@ -5,6 +5,6 @@
#ifndef HW_LIB_T_IIC_H
#define HW_LIB_T_IIC_H
void Test_iic(void *pVoid);
int Test_iic(void *pVoid);
#endif //HW_LIB_T_IIC_H

View File

@@ -28,7 +28,7 @@ uint8_t SDA_Read() {
return l;
}
void Test_iic(void *pVoid) {
int Test_iic(void *pVoid) {
SW_Dev_IIC dev = {
.CLK_SET = CLK_Pin,
.SDA_SET = SDA_Set,

View File

@@ -1,6 +1,6 @@
#ifndef HW_LIB_T_KEY_H
#define HW_LIB_T_KEY_H
void Test_Key(void *pVoid);
int Test_Key(void *pVoid);
#endif //HW_LIB_T_KEY_H

View File

@@ -38,7 +38,7 @@ void Key_Call(Key_t *key) {
}
}
void Test_Key(void *pVoid) {
int Test_Key(void *pVoid) {
Key_t k1, k2, k3, k4, k5, k6, ks;
key_init(&k1, SIM_KEY_UP, 1, SIM_Key_UP);
key_init(&k2, SIM_KEY_DOWN, 1, SIM_Key_DOWN);

View File

@@ -5,7 +5,7 @@
#ifndef HW_LIB_T_LIST_H
#define HW_LIB_T_LIST_H
extern void Test_List(void *pVoid);
extern int Test_List(void *pVoid);
extern void Test_Queue(void *pVoid1);
extern int Test_Queue(void *pVoid1);
#endif //HW_LIB_T_LIST_H

View File

@@ -38,7 +38,7 @@ void print(List_t *list) {
}
}
void Test_List(void *pVoid) {
int Test_List(void *pVoid) {
List_t list;
list_init(&list); // 初始化链表
@@ -102,7 +102,7 @@ void Test_List(void *pVoid) {
list_destroy(&list, NULL); // 销毁链表
}
void Test_Queue(void *pVoid) {
int Test_Queue(void *pVoid) {
Queue_List_t *deque = newQueue_List(sizeof(int)); // 创建一个int类型的双端队列
// 测试入队操作

View File

@@ -5,6 +5,6 @@
#ifndef HW_LIB_T_LVGL_H
#define HW_LIB_T_LVGL_H
void Test_lvgl(void *pVoid);
int Test_lvgl(void *pVoid);
#endif //HW_LIB_T_LVGL_H

View File

@@ -4,7 +4,7 @@
#include "lvgl.h"
#include <windows.h>
#include "t_lvgl.h"
#include "SDL3/SDL.h"
static void btn_event_cb(lv_event_t *e) {
lv_event_code_t code = lv_event_get_code(e);
@@ -33,21 +33,21 @@ void lv_example_get_started_1(void) {
lv_obj_center(label);
}
void Test_lvgl(void *pVoid) {
int Test_lvgl(void *pVoid) {
lv_init();
lv_port_disp_init();
lv_port_indev_init();
// lv_port_indev_init();
lv_example_get_started_1();
// lv_demo_widgets();
printf("\nTEST Widgets\n");
// printf("\nTEST Widgets\n");
while (1) {
/* Periodically call the lv_task handler.
* It could be done in a timer interrupt or an OS task too.*/
lv_timer_handler();
lv_tick_inc(5);
Sleep(5);
SDL_Delay(5);
}
return 0;
}

View File

@@ -1,6 +1,6 @@
#ifndef HW_LIB_T_OLED_H
#define HW_LIB_T_OLED_H
void Test_OLED(void *pVoid);
int Test_OLED(void *pVoid);
#endif //HW_LIB_T_OLED_H

View File

@@ -111,7 +111,7 @@ OLED_T oled = {
.call=Refresh_Call,
};
void Test_OLED(void *pVoid) {
int Test_OLED(void *pVoid) {
SIM_OLED_INIT(128, 64, CYAN, 0x0, 5, 0);
OLED_Init(&oled);

View File

@@ -5,5 +5,5 @@
#ifndef HW_LIB_T_SPI_H
#define HW_LIB_T_SPI_H
void Test_spi(void *pVoid);
int Test_spi(void *pVoid);
#endif //HW_LIB_T_SPI_H

View File

@@ -32,7 +32,7 @@ uint8_t Miso_Pin() {
return l;
}
void Test_spi(void *pVoid) {
int Test_spi(void *pVoid) {
SW_Dev_Spi ltl = {
.MOSI_SET=Mosi_Pin,
.SCK_SET=Sck_Pin,

View File

@@ -5,6 +5,6 @@
#ifndef HW_LIB_T_TASK_H
#define HW_LIB_T_TASK_H
_Noreturn void Test_task(void *pVoid);
_Noreturn int Test_task(void *pVoid);
#endif //HW_LIB_T_TASK_H

View File

@@ -40,7 +40,7 @@ void exampleTimer4Callback(Task_t *task, void *userData) {
}
}
void Test_task(void *pVoid) {
int Test_task(void *pVoid) {
TaskInit(GetTick);
TaskCreat(task1, 1000, -1, exampleTimer1Callback, "1000ms CYCLE task");
TaskCreat(task2, 5000, -1, exampleTimer2Callback, "5000ms ONCE task");

View File

@@ -1,6 +1,6 @@
#ifndef HW_LIB_T_TFT_H
#define HW_LIB_T_TFT_H
void Test_tft(void *);
int Test_tft(void *);
#endif //HW_LIB_T_TFT_H

View File

@@ -9,7 +9,7 @@
TFT_T demo_tft;
uint16_t xs = 0, ys = 0, xe = 0, ye = 0;
bool fill;
static SIM_Display_t tft_display;
SIM_Display_t tft_display;
//屏幕指令
#define WGRAM_CMD 0x5C
#define SETXCMD 0x2A
@@ -79,7 +79,7 @@ uint8_t tft_senddata(uint8_t *data, size_t len) {
if (len == 2) {
color_u.u8[1] = *data;
color_u.u8[0] = *data++;
SIM_Color_DrawPiexl(&tft_display, (SIM_Color_t) RGB565_to_RGB888(color_u.u16, true), xs, ys);
SIM_Color_DrawPiexl(&tft_display, (SIM_Color_t) RGB565_to_ARGB8888(color_u.u16, true), xs, ys);
// LOGT("Piexl","color:%x,x:%d,y:%d,len:%d",color_u.u16,xs,ys,len);
// SIM_Color_ImgFromBuffer(color,xs, ys, uint16_t width, 1)
} else {
@@ -88,7 +88,7 @@ uint8_t tft_senddata(uint8_t *data, size_t len) {
data++;
color_u.u8[0] = *data;
data++;
color[i] = RGB565_to_RGB888(color_u.u16, true) | 0xFF000000;
color[i] = RGB565_to_ARGB8888(color_u.u16, true);
}
SIM_Color_ImgFromBuffer(&tft_display, color, xs, ys, len / 2 - 1, 1);
// SIM_Color_DrawHLineBuffer(color, xs, ys, len / 2);
@@ -103,8 +103,7 @@ uint8_t tft_senddata(uint8_t *data, size_t len) {
return result;
}
void Test_tft(void *) {
int Test_tft(void *arg) {
//设备信息预填充
demo_tft.width = 480;//实际如有支持不用填(如ST7735/7796)
demo_tft.height = 320;//实际如有支持不用填(如ST7735/7796)
@@ -159,9 +158,10 @@ void Test_tft(void *) {
TFT_ShowBar(&demo_tft, 0, 142, demo_tft.width, 12, p);
TFT_ShowBar(&demo_tft, 0, 155, demo_tft.width, 3, p);
}
while (1) {
Sleep(5);
}
// while (1) {
//
// Sleep(5);
// }
SIM_Display_STOP(&tft_display);
return 0;
}