From cece4ce6325ea0ff265ad1d3970f99650a0d5e45 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 24 Nov 2022 21:28:54 +0100 Subject: [PATCH] - slide: use proc_put_hex() --- src/driver/slide.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/driver/slide.cpp b/src/driver/slide.cpp index a8db0b762..d846a45b7 100644 --- a/src/driver/slide.cpp +++ b/src/driver/slide.cpp @@ -60,23 +60,21 @@ COSDSlider::~COSDSlider() void COSDSlider::setValue(int val) { //printf("setvalue: %d\n",val); - char buffer[10]; + if (slideMode == MID2SIDE) { int w = MAX_WIDTH - val; + proc_put_hex("/proc/stb/fb/dst_width", w); + int l = (MAX_WIDTH - w) / 2; - sprintf(buffer, "%x\n", w); - proc_put("/proc/stb/fb/dst_width", buffer, strlen(buffer)); - sprintf(buffer, "%x\n", l); - proc_put("/proc/stb/fb/dst_left", buffer, strlen(buffer)); + proc_put_hex("/proc/stb/fb/dst_left", l); } else { - sprintf(buffer, "%x\n", val); - proc_put("/proc/stb/fb/dst_top", buffer, strlen(buffer)); + proc_put_hex("/proc/stb/fb/dst_top", val); } - sprintf(buffer, "%x\n", 1); - proc_put("/proc/stb/fb/dst_apply", buffer, strlen(buffer)); + + proc_put_hex("/proc/stb/fb/dst_apply", 1); } void COSDSlider::StartSlideIn()