Skip to content

Commit 1984ce6

Browse files
committed
Rendering on Star6C (ssc37x) fixed
1 parent c897cd3 commit 1984ce6

14 files changed

Lines changed: 1079 additions & 91 deletions

.vscode/c_cpp_properties.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Star6E",
5+
"includePath": [
6+
"${workspaceFolder}/**"
7+
],
8+
"defines": [
9+
"__SIGMASTAR__",
10+
"__INFINITY6__"
11+
],
12+
"compilerPath": "/usr/bin/gcc",
13+
"cStandard": "c11",
14+
"cppStandard": "c++17",
15+
"intelliSenseMode": "gcc-x64"
16+
},
17+
{
18+
"name": "Star6C",
19+
"includePath": [
20+
"${workspaceFolder}/**"
21+
],
22+
"defines": [
23+
"__SIGMASTAR__",
24+
"__INFINITY6__",
25+
"__INFINITY6C__"
26+
],
27+
"compilerPath": "/usr/bin/gcc",
28+
"cStandard": "c11",
29+
"cppStandard": "c++17",
30+
"intelliSenseMode": "gcc-x64"
31+
},
32+
{
33+
"name": "native(x86)",
34+
"includePath": [
35+
"${workspaceFolder}/**"
36+
],
37+
"defines": [
38+
"_x86"
39+
],
40+
"compilerPath": "/usr/bin/gcc",
41+
"cStandard": "c11",
42+
"cppStandard": "c++17",
43+
"intelliSenseMode": "gcc-x64"
44+
},
45+
{
46+
"name": "sigmastar-infinity6c",
47+
"compilerPath": "/home/home/src/msposd/toolchain/sigmastar-infinity6c/bin/arm-linux-gcc",
48+
"intelliSenseMode": "linux-gcc-arm",
49+
"cStandard": "c11",
50+
"includePath": [
51+
"/home/home/src/msposd",
52+
"/home/home/src/msposd/sdk/infinity6/include",
53+
"/home/home/src/msposd/toolchain/sigmastar-infinity6c/usr/include"
54+
],
55+
"defines": [
56+
"__SIGMASTAR__",
57+
"__INFINITY6__",
58+
"__INFINITY6C__"
59+
],
60+
"compilerArgs": [
61+
"-Wno-address-of-packed-member"
62+
]
63+
}
64+
],
65+
"version": 4
66+
}

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"name": "UDP_OSD",
77
"type": "cppdbg",
88
"request": "launch",
9-
"program": "${workspaceFolder}/msposd",
9+
"program": "${workspaceFolder}/msposd",
1010
"args": [
1111
"--master",
1212
"127.0.0.1:14550",

.vscode/settings.json

Lines changed: 80 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,86 @@
11
{
2-
"workbench.colorTheme": "Default High Contrast",
2+
"workbench.colorTheme": "Visual Studio Dark - C++",
3+
34
"editor.formatOnSave": false,
45
"editor.formatOnType": false,
56
"editor.formatOnPaste": false,
7+
8+
"C_Cpp.clang_format_path": "/usr/bin/clang-format",
9+
"C_Cpp.clang_format_style": "file",
10+
11+
"C_Cpp.intelliSenseEngine": "Default",
12+
"C_Cpp.enhancedColorization": "Enabled",
13+
"C_Cpp.dimInactiveRegions": true,
14+
"C_Cpp.inactiveRegionOpacity": 0.5,
15+
16+
"[c]": { "editor.semanticHighlighting.enabled": true },
17+
"[cpp]":{ "editor.semanticHighlighting.enabled": true },
18+
619
"files.associations": {
7-
"mavlink.h": "c",
8-
"system_error": "c",
9-
"chrono": "c",
10-
"common.h": "c",
11-
"array": "c",
12-
"string": "c",
13-
"string_view": "c",
14-
"msp_displayport.h": "c",
15-
"msp.h": "c",
16-
"graphics.h": "c",
17-
"thread": "c",
18-
"mi_rgn.h": "c",
19-
"mi_common.h": "c",
20-
"bitmap.h": "c",
21-
"random": "c",
22-
"format": "c",
23-
"compare": "c",
24-
"cstdint": "c",
25-
"functional": "c",
26-
"rope": "c",
27-
"ranges": "c",
28-
"variant": "c",
29-
"lodepng.h": "c",
30-
"any": "c",
31-
"expected": "c",
32-
"fstream": "c",
33-
"future": "c",
34-
"optional": "c",
35-
"shared_mutex": "c",
36-
"spanstream": "c",
37-
"stacktrace": "c",
38-
"stop_token": "c",
39-
"syncstream": "c",
40-
"tuple": "c",
41-
"string.h": "c",
42-
"mi_vpe.h": "c",
43-
"bitset": "c",
44-
"slist": "c",
45-
"initializer_list": "c",
46-
"span": "c",
47-
"regex": "c",
48-
"utility": "c",
49-
"*.tcc": "c",
50-
"iomanip": "c",
51-
"istream": "c",
52-
"streambuf": "c",
53-
"*.def": "c",
54-
"iterator": "c",
55-
"charconv": "c",
56-
"ratio": "c",
57-
"type_traits": "c",
58-
"hi_math.h": "c",
59-
"cstdlib": "c",
60-
"xlib.h": "c",
61-
"stdbool.h": "c",
62-
"xutil.h": "c",
63-
"xatom.h": "c",
64-
"region.h": "c",
65-
"cairo-xlib.h": "c",
66-
"stdint-uintn.h": "c",
67-
"interface.h": "c",
68-
"valarray": "c",
69-
"complex": "c",
70-
"source_location": "c"
20+
"mavlink.h": "c",
21+
"system_error": "c",
22+
"chrono": "c",
23+
"common.h": "c",
24+
"array": "c",
25+
"string": "c",
26+
"string_view": "c",
27+
"msp_displayport.h": "c",
28+
"msp.h": "c",
29+
"graphics.h": "c",
30+
"thread": "c",
31+
"mi_rgn.h": "c",
32+
"mi_common.h": "c",
33+
"bitmap.h": "c",
34+
"random": "c",
35+
"format": "c",
36+
"compare": "c",
37+
"cstdint": "c",
38+
"functional": "c",
39+
"rope": "c",
40+
"ranges": "c",
41+
"variant": "c",
42+
"lodepng.h": "c",
43+
"any": "c",
44+
"expected": "c",
45+
"fstream": "c",
46+
"future": "c",
47+
"optional": "c",
48+
"shared_mutex": "c",
49+
"spanstream": "c",
50+
"stacktrace": "c",
51+
"stop_token": "c",
52+
"syncstream": "c",
53+
"tuple": "c",
54+
"string.h": "c",
55+
"mi_vpe.h": "c",
56+
"bitset": "c",
57+
"slist": "c",
58+
"initializer_list": "c",
59+
"span": "c",
60+
"regex": "c",
61+
"utility": "c",
62+
"*.tcc": "c",
63+
"iomanip": "c",
64+
"istream": "c",
65+
"streambuf": "c",
66+
"*.def": "c",
67+
"iterator": "c",
68+
"charconv": "c",
69+
"ratio": "c",
70+
"type_traits": "c",
71+
"hi_math.h": "c",
72+
"cstdlib": "c",
73+
"xlib.h": "c",
74+
"stdbool.h": "c",
75+
"xutil.h": "c",
76+
"xatom.h": "c",
77+
"region.h": "c",
78+
"cairo-xlib.h": "c",
79+
"stdint-uintn.h": "c",
80+
"interface.h": "c",
81+
"valarray": "c",
82+
"complex": "c",
83+
"source_location": "c"
7184
}
72-
}
85+
}
86+

bmp/macros.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#pragma once
2+
3+
#include <stdio.h>
4+
#include <string.h>
5+
6+
#define HAL_DANGER(mod, x, ...) \
7+
do { \
8+
fprintf(stderr, "[%s] \033[31m", (mod)); \
9+
fprintf(stderr, (x), ##__VA_ARGS__); \
10+
fprintf(stderr, "\033[0m"); \
11+
} while (0)
12+
13+
#define HAL_ERROR(mod, x, ...) \
14+
do { \
15+
fprintf(stderr, "[%s] \033[31m", (mod)); \
16+
fprintf(stderr, (x), ##__VA_ARGS__); \
17+
fprintf(stderr, "\033[0m"); \
18+
return EXIT_FAILURE; \
19+
} while (0)
20+
21+
#define HAL_INFO(mod, x, ...) \
22+
do { \
23+
fprintf(stderr, "[%s] ", (mod)); \
24+
fprintf(stderr, (x), ##__VA_ARGS__); \
25+
} while (0)
26+
27+
#define HAL_WARNING(mod, x, ...) \
28+
do { \
29+
fprintf(stderr, "[%s] \033[33m", (mod)); \
30+
fprintf(stderr, (x), ##__VA_ARGS__); \
31+
fprintf(stderr, "\033[0m"); \
32+
} while (0)
33+
34+
#ifndef CEILING
35+
#define CEILING_POS(X) ((X-(int)(X)) > 0 ? (int)(X+1) : (int)(X))
36+
#define CEILING_NEG(X) (int)(X)
37+
#define CEILING(X) ( ((X) > 0) ? CEILING_POS(X) : CEILING_NEG(X) )
38+
#endif
39+
40+
#define EMPTY(x) (x[0] == '\0')
41+
#define ENDS_WITH(a, b) \
42+
((strlen(a) > strlen(b)) && !strcmp(a + strlen(a) - strlen(b), b))
43+
#define EQUALS(a, b) !strcmp(a, b)
44+
#define EQUALS_CASE(a, b) !strcasecmp(a, b)
45+
#define STARTS_WITH(a, b) !strncmp(a, b, strlen(b))

bmp/region.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#include "region.h"
22

3+
#if defined(__INFINITY6C__)
4+
#include "bmp/star/i6c_hal.c"
5+
#endif
6+
37
// https://wx.comake.online/doc/ds82ff82j7jsd9-SSD220/customer/development/mi/en/exclude/mi_rgn.html
48

59
#ifdef __SIGMASTAR__
@@ -25,7 +29,9 @@ int create_region(int *handle, int x, int y, int width, int height) {
2529
MI_RGN_ChnPortParam_t stChnAttrCurrent;
2630

2731
#if __INFINITY6C__
28-
stChn.eModId = E_MI_MODULE_ID_VENC;
32+
hal_rect rect = { .height = height, .width = width,
33+
.x = x, .y = y };
34+
return i6c_region_create(0,rect,255);
2935
#else
3036
stChn.eModId = E_MI_RGN_MODID_VPE;
3137
#endif
@@ -344,9 +350,11 @@ void *get_directBMP(int handle) {
344350
MI_RGN_CanvasInfo_t stCanvasInfo;
345351
memset(&stCanvasInfo, 0, sizeof(stCanvasInfo));
346352
int s32Ret = GetCanvas(handle, &stCanvasInfo);
347-
// printf("OSD Handle:%d CanvasStride: %d , Canvas size : %d:%d\r\n",
348-
// handle, stCanvasInfo.u32Stride, stCanvasInfo.stSize.u32Width,
349-
// stCanvasInfo.stSize.u32Height);
353+
354+
if (s32Ret)
355+
printf("GetCanvas Res: %X OSD Handle:%d CanvasStride: %d , Canvas size : %d:%d\r\n",
356+
s32Ret, handle, stCanvasInfo.u32Stride, stCanvasInfo.stSize.u32Width,
357+
stCanvasInfo.stSize.u32Height);
350358
return (void *)(stCanvasInfo.virtAddr);
351359
#endif
352360
return NULL;
@@ -422,8 +430,8 @@ int unload_region(int *handle) {
422430
}
423431
#ifdef __SIGMASTAR__
424432

425-
int GetCanvas(int handle, MI_RGN_CanvasInfo_t *stCanvasInfo) {
426-
int s32Result = MI_RGN_GetCanvasInfo(DEV handle, stCanvasInfo);
433+
int GetCanvas(int handle, MI_RGN_CanvasInfo_t *stCanvasInfo) {
434+
int s32Result = MI_RGN_GetCanvasInfo(DEV handle, stCanvasInfo);
427435
if (s32Result != MI_RGN_OK)
428436
return s32Result;
429437

0 commit comments

Comments
 (0)