Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.

Commit 51db49b

Browse files
ymCopilot
andauthored
feat: add lv_obj_fade_in, lv_obj_fade_out (#6)
* feat: add lv_obj_fade_in, lv_obj_fade_out * Update ctrl.c Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 74e959b commit 51db49b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

ctrl.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,32 @@ void handle_lvgl_call(const int seq, const char *method, const char *json, size_
333333
write_json_error(ctrl_client_fd, seq, "missing flag parameter");
334334
}
335335
}
336+
else if (strcmp(method, "lv_obj_fade_in") == 0)
337+
{
338+
uint32_t duration = 0;
339+
if (json_scanf(json, json_len, "{params: {duration: %u}}", &duration) > 0)
340+
{
341+
lv_obj_fade_in(obj, duration, 0);
342+
write_json(ctrl_client_fd, "{seq: %d}", seq);
343+
}
344+
else
345+
{
346+
write_json_error(ctrl_client_fd, seq, "missing duration parameter");
347+
}
348+
}
349+
else if (strcmp(method, "lv_obj_fade_out") == 0)
350+
{
351+
uint32_t duration = 0;
352+
if (json_scanf(json, json_len, "{params: {duration: %u}}", &duration) > 0)
353+
{
354+
lv_obj_fade_out(obj, duration, 0);
355+
write_json(ctrl_client_fd, "{seq: %d}", seq);
356+
}
357+
else
358+
{
359+
write_json_error(ctrl_client_fd, seq, "missing duration parameter");
360+
}
361+
}
336362
else
337363
{
338364
write_json_error(ctrl_client_fd, seq, "unknown method");

0 commit comments

Comments
 (0)