mirror of https://github.com/jetkvm/kvm.git
fix c build warnings
This commit is contained in:
parent
cf8e33b011
commit
29226a629c
|
|
@ -30,8 +30,17 @@ void jetkvm_set_video_handler(jetkvm_video_handler_t *handler) {
|
||||||
video_handler = handler;
|
video_handler = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static jetkvm_indev_handler_t *jetkvm_indev_handler = NULL;
|
||||||
|
|
||||||
|
static void jetkvm_indev_wrapper(lv_event_code_t code) {
|
||||||
|
if (jetkvm_indev_handler != NULL) {
|
||||||
|
(*jetkvm_indev_handler)((int)code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void jetkvm_set_indev_handler(jetkvm_indev_handler_t *handler) {
|
void jetkvm_set_indev_handler(jetkvm_indev_handler_t *handler) {
|
||||||
lvgl_set_indev_handler(handler);
|
jetkvm_indev_handler = handler;
|
||||||
|
lvgl_set_indev_handler(jetkvm_indev_wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
void jetkvm_set_rpc_handler(jetkvm_rpc_handler_t *handler) {
|
void jetkvm_set_rpc_handler(jetkvm_rpc_handler_t *handler) {
|
||||||
|
|
@ -45,8 +54,7 @@ void jetkvm_call_rpc_handler(const char *method, const char *params) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *jetkvm_ui_event_code_to_name(int code) {
|
const char *jetkvm_ui_event_code_to_name(int code) {
|
||||||
lv_event_code_t cCode = (lv_event_code_t)code;
|
return lv_event_code_get_name((lv_event_code_t)code);
|
||||||
return lv_event_code_get_name(code);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void video_report_format(bool ready, const char *error, u_int16_t width, u_int16_t height, double frame_per_second)
|
void video_report_format(bool ready, const char *error, u_int16_t width, u_int16_t height, double frame_per_second)
|
||||||
|
|
@ -386,7 +394,7 @@ char *jetkvm_video_get_edid_hex() {
|
||||||
if (edid_len < 0) {
|
if (edid_len < 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return bytes_to_hex(edid, edid_len);
|
return (char *)bytes_to_hex(edid, edid_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
jetkvm_video_state_t *jetkvm_video_get_status() {
|
jetkvm_video_state_t *jetkvm_video_get_status() {
|
||||||
|
|
@ -394,7 +402,7 @@ jetkvm_video_state_t *jetkvm_video_get_status() {
|
||||||
}
|
}
|
||||||
|
|
||||||
char *jetkvm_video_log_status() {
|
char *jetkvm_video_log_status() {
|
||||||
return videoc_log_status();
|
return (char *)videoc_log_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
int jetkvm_video_init() {
|
int jetkvm_video_init() {
|
||||||
|
|
|
||||||
|
|
@ -117,8 +117,6 @@ const char *videoc_log_status()
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
char *buffer = NULL;
|
char *buffer = NULL;
|
||||||
size_t buffer_size = 0;
|
|
||||||
ssize_t bytes_read;
|
|
||||||
|
|
||||||
fd = open(V4L_SUBDEV, O_RDWR);
|
fd = open(V4L_SUBDEV, O_RDWR);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@
|
||||||
#include "ui_index.h"
|
#include "ui_index.h"
|
||||||
#include "ctrl.h"
|
#include "ctrl.h"
|
||||||
|
|
||||||
#define DISP_BUF_SIZE (300 * 240 * 2)
|
// #define DISP_BUF_SIZE (300 * 240 * 2)
|
||||||
static lv_color_t buf[DISP_BUF_SIZE];
|
// static lv_color_t buf[DISP_BUF_SIZE];
|
||||||
|
|
||||||
indev_handler_t *indev_handler = NULL;
|
indev_handler_t *indev_handler = NULL;
|
||||||
|
|
||||||
|
|
@ -97,8 +97,8 @@ void lvgl_set_rotation(lv_display_t *disp, u_int16_t rotation) {
|
||||||
}
|
}
|
||||||
|
|
||||||
log_info("refreshing objects");
|
log_info("refreshing objects");
|
||||||
lv_obj_report_style_change(&flex_screen_style);
|
lv_obj_report_style_change(flex_screen_style);
|
||||||
lv_obj_report_style_change(&flex_screen_menu_style);
|
lv_obj_report_style_change(flex_screen_menu_style);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t custom_tick_get(void)
|
uint32_t custom_tick_get(void)
|
||||||
|
|
@ -151,7 +151,7 @@ const char *ui_get_current_screen() {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_img_dsc_t *ui_get_image(const char *name) {
|
const lv_img_dsc_t *ui_get_image(const char *name) {
|
||||||
for (size_t i = 0; i < ui_images_size; i++) {
|
for (size_t i = 0; i < ui_images_size; i++) {
|
||||||
if (strcmp(ui_images[i].name, name) == 0) {
|
if (strcmp(ui_images[i].name, name) == 0) {
|
||||||
return ui_images[i].img;
|
return ui_images[i].img;
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,15 @@ lv_style_t *ui_get_style(const char *name);
|
||||||
* @brief Get the image with the given name
|
* @brief Get the image with the given name
|
||||||
*
|
*
|
||||||
* @param name The name of the image
|
* @param name The name of the image
|
||||||
* @return lv_img_dsc_t* The image with the given name
|
* @return const lv_img_dsc_t* The image with the given name
|
||||||
*/
|
*/
|
||||||
lv_img_dsc_t *ui_get_image(const char *name);
|
const lv_img_dsc_t *ui_get_image(const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the current screen name
|
||||||
|
*
|
||||||
|
* @return const char* The name of the current screen
|
||||||
|
*/
|
||||||
|
const char *ui_get_current_screen();
|
||||||
|
|
||||||
#endif // SCREEN_H
|
#endif // SCREEN_H
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
#include "screens.h"
|
#include "screens.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
#include "vars.h"
|
#include "vars.h"
|
||||||
|
|
||||||
|
|
@ -81,7 +82,6 @@ const int REBOOT_HOLD_TIME = 5;
|
||||||
|
|
||||||
void action_reset_config(lv_event_t * e) {
|
void action_reset_config(lv_event_t * e) {
|
||||||
lv_event_code_t event_code = lv_event_get_code(e);
|
lv_event_code_t event_code = lv_event_get_code(e);
|
||||||
lv_obj_t *obj = lv_event_get_target(e);
|
|
||||||
|
|
||||||
if (event_code == LV_EVENT_PRESSED) {
|
if (event_code == LV_EVENT_PRESSED) {
|
||||||
t_reset_config = lv_tick_get();
|
t_reset_config = lv_tick_get();
|
||||||
|
|
@ -112,7 +112,6 @@ void action_reset_config(lv_event_t * e) {
|
||||||
|
|
||||||
void action_reboot(lv_event_t * e) {
|
void action_reboot(lv_event_t * e) {
|
||||||
lv_event_code_t event_code = lv_event_get_code(e);
|
lv_event_code_t event_code = lv_event_get_code(e);
|
||||||
lv_obj_t *obj = lv_event_get_target(e);
|
|
||||||
|
|
||||||
if (event_code == LV_EVENT_PRESSED) {
|
if (event_code == LV_EVENT_PRESSED) {
|
||||||
t_reboot = lv_tick_get();
|
t_reboot = lv_tick_get();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue