Skip to content

Commit

Permalink
Address rockchip build
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorxda committed Jan 25, 2025
1 parent c9af432 commit d33f700
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build_rockchip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ host=https://cloud.debian.org/images/cloud/bullseye
release=latest
system=debian-11-generic-arm64.tar
if [ ! -f disk.raw ]; then
wget -nv ${host}/${release}/${system}.xz
curl -s -k -L ${host}/${release}/${system}.xz -O
tar -xf ${system}.xz
rm ${system}.xz
fi
Expand Down
14 changes: 7 additions & 7 deletions msposd.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ static void serial_read_cb(struct bufferevent *bev, void *arg) {
if (verbose) {
if (DrawOSD)
printf(
"UART Events:%u MessagesTTL:%u AttitMSGs:%u(%dms) Bytes/S:%u "
"UART Events:%lu MessagesTTL:%u AttitMSGs:%u(%dms) Bytes/S:%lu "
"FPS:%u of %u (skipped:%d), AvgFrameLoad ms:%d | %d | %d | \r\n",
stat_pckts, stat_msp_msgs, stat_msp_msg_attitude,
(stat_attitudeDelay / (stat_msp_msg_attitude + 1)), stat_bytes,
Expand All @@ -767,8 +767,8 @@ static void serial_read_cb(struct bufferevent *bev, void *arg) {
stat_draw_overlay_2 / stat_screen_refresh_count,
stat_draw_overlay_3 / stat_screen_refresh_count);
else
printf("UART Events:%u MessagesTTL:%u AttitMSGs:%u(%dms) Bytes/S "
"Recvd:%u Sent:%u, Screen FPS:%u MSP_FPS:%u "
printf("UART Events:%lu MessagesTTL:%u AttitMSGs:%u(%dms) Bytes/S "
"Recvd:%lu Sent:%u, Screen FPS:%u MSP_FPS:%u "
"MSP_UDP_Pckts:%u, AvgFrameLoad ms:%d | %d | \r\n",
stat_pckts, stat_msp_msgs, stat_msp_msg_attitude,
(stat_attitudeDelay / (stat_msp_msg_attitude + 1)), stat_bytes,
Expand Down Expand Up @@ -808,7 +808,7 @@ static void serial_read_cb(struct bufferevent *bev, void *arg) {
if (!version_shown &&
ttl_packets % 10 ==
3) // If garbage only, give some feedback do diagnose
printf("Packets:%d Bytes:%d\n", ttl_packets, ttl_bytes);
printf("Packets:%ld Bytes:%ld\n", ttl_packets, ttl_bytes);

if (aggregate == 0) {
if (sendto(out_sock, data, packet_len, 0, (struct sockaddr *)&sin_out,
Expand Down Expand Up @@ -963,7 +963,7 @@ static bool ReadSerialSimple(int showstat) {
stat_screen_refresh_count++;
if (verbose) {
if (DrawOSD)
printf("UART Events:%u MessagesTTL:%u AttitMSGs:%u(%dms) Bytes/S:%u "
printf("UART Events:%lu MessagesTTL:%u AttitMSGs:%u(%dms) Bytes/S:%lu "
"FPS:%u of %u (skipped:%d), AvgFrameLoad ms:%d | %d | %d | \r\n",
stat_pckts, stat_msp_msgs, stat_msp_msg_attitude,
(stat_attitudeDelay / (stat_msp_msg_attitude + 1)), stat_bytes,
Expand All @@ -973,8 +973,8 @@ static bool ReadSerialSimple(int showstat) {
stat_draw_overlay_2 / stat_screen_refresh_count,
stat_draw_overlay_3 / stat_screen_refresh_count);
else
printf("UART Events:%u MessagesTTL:%u AttitMSGs:%u(%dms) Bytes/S "
"Recvd:%u Sent:%u, Screen FPS:%u MSP_FPS:%u MSP_UDP_Pckts:%u, "
printf("UART Events:%lu MessagesTTL:%u AttitMSGs:%u(%dms) Bytes/S "
"Recvd:%lu Sent:%u, Screen FPS:%u MSP_FPS:%u MSP_UDP_Pckts:%u, "
"AvgFrameLoad ms:%d | %d | \r\n",
stat_pckts, stat_msp_msgs, stat_msp_msg_attitude,
(stat_attitudeDelay / (stat_msp_msg_attitude + 1)), stat_bytes,
Expand Down
3 changes: 1 addition & 2 deletions osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,6 @@ bool DrawTextOnOSDBitmap(char *msg) {
#else
asprintf(&font, "/usr/share/fonts/truetype/%s.ttf",
osds[FULL_OVERLAY_ID].font);

#endif

if (!osd_msg_enabled) {
Expand Down Expand Up @@ -1954,7 +1953,7 @@ static void clear_screen() {
// LastDrawn=(get_time_ms())+500;///give 200ms no refresh to load data in
// buffer
} else if (verbose)
printf("%lu Clear screen skipped\r\n",
printf("%u Clear screen skipped\r\n",
(uint32_t)((uint32_t)get_time_ms()) % 10000);
// LastDrawn=(get_time_ms())+200;//give 120ms more to load data
}
Expand Down
8 changes: 5 additions & 3 deletions osd/util/Render_gs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#include "../../bmp/bitmap.h"
#include <X11/Xatom.h>
#include <X11/Xlib.h>
Expand All @@ -15,11 +14,12 @@

#if defined(_x86)
Display *display = NULL;
Window window = NULL;
Window window;
Pixmap backbuffer_pixmap;
bool forcefullscreen = true;
extern struct event_base *base;
struct event *x11_event = NULL;
extern int AHI_TiltY;
Window RootWindow;
#endif

Expand All @@ -42,7 +42,9 @@ cairo_t *cr_back = NULL;
extern bool verbose;

#if defined(_x86)
extern int AHI_TiltY;
void rotate_point(Point original, Point img_center, double angle_degrees,
Point *rotated);

void handle_key_press(XEvent *event) {
KeySym keysym = XLookupKeysym(&event->xkey, 0); // Map keycode to keysym

Expand Down

0 comments on commit d33f700

Please sign in to comment.