Skip to content

Commit e930363

Browse files
committed
add locks and missing comments
1 parent f106d30 commit e930363

File tree

13 files changed

+311
-83
lines changed

13 files changed

+311
-83
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ KVM_PKG_NAME := github.com/jetkvm/kvm
1010

1111
BUILDKIT_FLAVOR := arm-rockchip830-linux-uclibcgnueabihf
1212
BUILDKIT_PATH ?= /opt/jetkvm-native-buildkit
13-
SKIP_NATIVE_IF_EXISTS ?= 1
13+
SKIP_NATIVE_IF_EXISTS ?= 0
1414

1515

1616
GO_BUILD_ARGS := -tags netgo -tags timetzdata
@@ -111,7 +111,7 @@ dev_release: frontend build_dev
111111
rclone copyto bin/jetkvm_app r2://jetkvm-update/app/$(VERSION_DEV)/jetkvm_app
112112
rclone copyto bin/jetkvm_app.sha256 r2://jetkvm-update/app/$(VERSION_DEV)/jetkvm_app.sha256
113113

114-
build_release: frontend
114+
build_release: frontend build_native
115115
@echo "Building release..."
116116
$(GO_CMD) build \
117117
-ldflags="$(GO_LDFLAGS) -X $(KVM_PKG_NAME).builtAppVersion=$(VERSION)" \

dev_deploy.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ if [ -z "$REMOTE_HOST" ]; then
104104
fi
105105

106106
# Build the development version on the host
107-
if [ "$SKIP_UI_BUILD" = false ]; then
107+
# When using `make build_release`, the frontend will be built regardless of the `SKIP_UI_BUILD` flag
108+
if [[ "$SKIP_UI_BUILD" = false && "$INSTALL_APP" = false ]]; then
108109
msg_info "▶ Building frontend"
109110
make frontend
110111
fi

internal/native/cgo/edid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ const char *videoc_log_status()
173173
}
174174
else
175175
{
176-
log_error("Failed to read kernel log\n");
176+
log_error("Failed to read kernel log");
177177
return NULL;
178178
}
179179

internal/native/cgo/log_handler.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,25 @@
22
#define LOG_HANDLER_H
33

44
typedef void (jetkvm_log_handler_t)(int level, const char *filename, const char *funcname, const int line, const char *message);
5+
6+
/**
7+
* @brief Log a message
8+
*
9+
* @param level The level of the message
10+
* @param filename The filename of the message
11+
* @param funcname The function name of the message
12+
* @param line The line number of the message
13+
* @param message The message to log
14+
* @return void
15+
*/
516
void log_message(int level, const char *filename, const char *funcname, const int line, const char *message);
617

18+
/**
19+
* @brief Set the log handler
20+
*
21+
* @param handler The handler to set
22+
* @return void
23+
*/
724
void log_set_handler(jetkvm_log_handler_t *handler);
825

926
#endif

internal/native/cgo/screen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ lv_img_dsc_t *ui_get_image(const char *name) {
188188
void ui_set_text(const char *name, const char *text) {
189189
lv_obj_t *obj = ui_get_obj(name);
190190
if(obj == NULL) {
191-
log_error("ui_set_text %s %s, obj not found\n", name, text);
191+
log_error("ui_set_text %s %s, obj not found", name, text);
192192
return;
193193
}
194194
lv_label_set_text(obj, text);

internal/native/cgo/screen.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,37 @@ void lvgl_tick(void);
1212

1313
void lvgl_set_rotation(lv_display_t *disp, u_int16_t rotation);
1414

15+
/**
16+
* @brief Set the text of an object
17+
*
18+
* @param name The name of the object
19+
* @param text The text to set
20+
* @return void
21+
*/
1522
void ui_set_text(const char *name, const char *text);
1623

24+
/**
25+
* @brief Get the object with the given name
26+
*
27+
* @param name The name of the object
28+
* @return lv_obj_t* The object with the given name
29+
*/
1730
lv_obj_t *ui_get_obj(const char *name);
31+
32+
/**
33+
* @brief Get the style with the given name
34+
*
35+
* @param name The name of the style
36+
* @return lv_style_t* The style with the given name
37+
*/
1838
lv_style_t *ui_get_style(const char *name);
39+
40+
/**
41+
* @brief Get the image with the given name
42+
*
43+
* @param name The name of the image
44+
* @return lv_img_dsc_t* The image with the given name
45+
*/
1946
lv_img_dsc_t *ui_get_image(const char *name);
2047

2148
#endif // SCREEN_H

0 commit comments

Comments
 (0)