Skip to content

Commit

Permalink
Add infinity6c support
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorxda committed Jan 22, 2025
1 parent c28d645 commit a381947
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 22 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ star6b0: version.h
$(eval LIB = -lcam_os_wrapper -lm -lmi_rgn -lmi_sys)
$(BUILD)

star6c: version.h
$(eval SDK = ./sdk/infinity6)
$(eval CFLAGS += -D__SIGMASTAR__ -D__INFINITY6__ -D__INFINITY6E__)
$(eval LIB = -lcam_os_wrapper -lm -lmi_rgn -lmi_sys -lmi_common)
$(BUILD)

star6e: version.h
$(eval SDK = ./sdk/infinity6)
$(eval CFLAGS += -D__SIGMASTAR__ -D__INFINITY6__ -D__INFINITY6E__)
Expand All @@ -57,4 +63,4 @@ rockchip: version.h
$(eval CFLAGS += -D__ROCKCHIP__)
$(eval LIB = `pkg-config --libs cairo x11` -lm -lrt)
$(eval BUILD = $(CC) $(SRCS) -I $(SDK)/include -L $(DRV) $(CFLAGS) $(LIB) -levent_core -O0 -g -o $(OUTPUT))
$(BUILD)
$(BUILD)
4 changes: 1 addition & 3 deletions bmp/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ extern "C"
short width, height;
} RECT;

int sysinfo(struct sysinfo *);

static void fatal(const char *message)
{
fprintf(stderr, "%s\n", message);
Expand Down Expand Up @@ -182,4 +180,4 @@ extern int PIXEL_FORMAT_DEFAULT;
}
#endif
#endif
#endif
#endif
12 changes: 6 additions & 6 deletions bmp/region.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@


#ifdef __SIGMASTAR__
PIXEL_FORMAT_DEFAULT=E_MI_RGN_PIXEL_FORMAT_I4; //0 for PIXEL_FORMAT_1555 , 4 for E_MI_RGN_PIXEL_FORMAT_I8
int PIXEL_FORMAT_DEFAULT = E_MI_RGN_PIXEL_FORMAT_I4; //0 for PIXEL_FORMAT_1555 , 4 for E_MI_RGN_PIXEL_FORMAT_I8
#else
PIXEL_FORMAT_DEFAULT=3; //0 for PIXEL_FORMAT_1555 , 4 for E_MI_RGN_PIXEL_FORMAT_I8
int PIXEL_FORMAT_DEFAULT = 3; //0 for PIXEL_FORMAT_1555 , 4 for E_MI_RGN_PIXEL_FORMAT_I8
#endif

extern bool verbose;
Expand Down Expand Up @@ -371,10 +371,10 @@ unsigned long set_bitmapEx(int handle, BITMAP *bitmap, int BitsPerPixel){
//this will break, the pointer to memory is no longer valid!
//memset((void *)(stCanvasInfo.virtAddr), PIXEL_FORMAT_DEFAULT==PIXEL_FORMAT_I4 ? 0xFF : 0x00 , bitmap->u32Height * getRowStride(bitmap->u32Width , BitsPerPixel));


return stCanvasInfo.virtAddr;
return stCanvasInfo.virtAddr;
#else
return s32Ret;
#endif
return NULL;
}

int unload_region(int *handle)
Expand Down Expand Up @@ -477,4 +477,4 @@ void DrawBitmap1555ToI4(
// //if (MI_RGN_UpdateCanvas(hHandle) != MI_RGN_OK)
// // return s32Result;

// }
// }
9 changes: 3 additions & 6 deletions bmp/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,9 @@ static void loadglyph(const SFT *sft, SFT_UChar codepoint, SFT_Glyph *glyph, SFT
if (sft_gmetrics(sft, *glyph, metrics) < 0)
fatal("sft_gmetrics failed");
}
/*
int getRowStride(int width, int BitsPerPixel){
int rowLength = width * BitsPerPixel;
return (rowLength + 32 - ((rowLength-1) % 32)) >> 3;
}
*/

int getRowStride(int width, int BitsPerPixel);

static void newimage(SFT_Image *image, int width, int height, int color)
{
//size_t size = (size_t)(width * height * 2);
Expand Down
4 changes: 4 additions & 0 deletions compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@
#include <sys/socket.h>
#include <sys/uio.h>

int __assert;
int __ctype_b;
int __stdin;

void backtrace(void) {}
void backtrace_symbols(void) {}

#if !defined(_x86) && !defined(__ROCKCHIP__)
int __fgetc_unlocked(FILE *stream) {
return fgetc(stream);
Expand Down
8 changes: 4 additions & 4 deletions msposd.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ bool mspVTXenabled = false;
bool vtxMenuEnabled = false;

//libevent base main loop
extern struct event_base *base = NULL;
struct event_base *base = NULL;

int serial_fd = 0;

Expand Down Expand Up @@ -802,7 +802,7 @@ static void serial_read_cb(struct bufferevent *bev, void *arg)
sizeof(sin_out)) == -1) {
perror("sendto()");
//event_base_loopbreak(base);
return false;
return;
}
}

Expand Down Expand Up @@ -982,7 +982,7 @@ static bool ReadSerialSimple(int showstat){
// Read from the serial port once per interval
int packet_len = read(serial_fd, data, sizeof(data));
if (packet_len < 0)
return;
return false;

stat_pckts++;
stat_bytes+=packet_len;
Expand Down Expand Up @@ -1078,7 +1078,7 @@ static int handle_data(const char *port_name, int baudrate,
struct sockaddr_in sin_in = {
.sin_family = AF_INET,
};
if (!parse_host_port(port_name, (struct port_name *)&sin_in.sin_addr.s_addr,
if (!parse_host_port(port_name, (struct in_addr *)&sin_in.sin_addr.s_addr,
&sin_in.sin_port))
goto err;

Expand Down
7 changes: 5 additions & 2 deletions osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ extern int SendWfbLogToGround();
extern bool monitor_wfb;
extern int last_board_temp;

void fill(char* str);
void SetOSDMsg(char* msg);

uint64_t get_time_ms() // in milliseconds
{
struct timespec ts;
Expand Down Expand Up @@ -1858,12 +1861,12 @@ unsigned char* loadPngToBMP(const char* filename, unsigned int* width, unsigned
convertRGBAToI4( pngData, *width , *height, bmpData, &g_stPaletteTable);
else if (PIXEL_FORMAT_DEFAULT==PIXEL_FORMAT_8888){
// memcpy(bmpData,pngData,bmpSize);
convertRGBAToARGB( pngData, *width , *height, bmpData);
convertRGBAToARGB( pngData, *width , *height, (uint32_t*)bmpData);
#if defined(_x86) || defined(__ROCKCHIP__)
premultiplyAlpha((uint32_t*) bmpData, *width, *height);//RGBA format needs to be converted when using transparency?
#endif
}else
convertRGBAToARGB1555( pngData, *width , *height, bmpData);
convertRGBAToARGB1555( pngData, *width , *height, (uint16_t*)bmpData);

// Clean up
free(pngData);
Expand Down

0 comments on commit a381947

Please sign in to comment.