[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-mdb] branch master updated: display backlight invert option
From: |
gnunet |
Subject: |
[taler-taler-mdb] branch master updated: display backlight invert option flag |
Date: |
Tue, 10 Dec 2019 14:58:02 +0100 |
This is an automated email from the git hooks/post-receive script.
marco-boss pushed a commit to branch master
in repository taler-mdb.
The following commit(s) were added to refs/heads/master by this push:
new d0eb9b5 display backlight invert option flag
d0eb9b5 is described below
commit d0eb9b58e045b1fe08071b471b5f335f26122878
Author: Boss Marco <address@hidden>
AuthorDate: Tue Dec 10 14:57:51 2019 +0100
display backlight invert option flag
---
.gitignore | 1 +
src/main.c | 19 ++++++++++++++++---
src/{main.c => main.c.autosave} | 30 +++++++++++++++++++++++++++---
3 files changed, 44 insertions(+), 6 deletions(-)
diff --git a/.gitignore b/.gitignore
index 2d69254..b09e31a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,7 @@ src/.deps/
src/Makefile
src/Makefile.am~
src/Makefile.in
+src/taler-mdb
stamp-h1
*.pro*
.qmake*
diff --git a/src/main.c b/src/main.c
index c719f81..e9ddb5a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -552,6 +552,10 @@ static char *framebuffer_device_filename;
*/
static char *framebuffer_backlight_filename;
+static int backlight_invert;
+static char backlight_on = '1';
+static char backlight_off = '0';
+
/**
* Name of the UART device with the MDB (i.e. /dev/ttyAMA0).
*/
@@ -712,7 +716,7 @@ show_qrcode (const char *uri)
QRinput_free (qri);
if (0 < qrDisplay.backlightfd)
- (void) write (qrDisplay.backlightfd, "1", 1);
+ (void) write (qrDisplay.backlightfd, &backlight_on, 1);
}
@@ -755,7 +759,7 @@ cleanup_payment (struct PaymentActivity *pa)
qrDisplay.var_info.xres * qrDisplay.var_info.yres
* sizeof (uint16_t));
if (0 < qrDisplay.backlightfd)
- (void) write (qrDisplay.backlightfd, "0", 1);
+ (void) write (qrDisplay.backlightfd, &backlight_off, 1);
#endif
GNUNET_free (pa->taler_pay_uri);
}
@@ -2422,7 +2426,12 @@ run (void *cls,
}
else
{
- (void) write (qrDisplay.backlightfd, "0", 1);
+ if (backlight_invert)
+ {
+ backlight_on = '0';
+ backlight_off = '1';
+ }
+ (void) write (qrDisplay.backlightfd, &backlight_off, 1);
}
}
else
@@ -2508,6 +2517,10 @@ main (int argc,
"disable-tty",
"disable all keyboard interactions (for running
from systemd)",
&disable_tty),
+ GNUNET_GETOPT_option_flag ('i',
+ "backlight-invert",
+ "invert the backlight on/off values (standard
on = 1)",
+ &backlight_invert),
GNUNET_GETOPT_OPTION_END
};
int have_tty;
diff --git a/src/main.c b/src/main.c.autosave
similarity index 98%
copy from src/main.c
copy to src/main.c.autosave
index c719f81..20487f5 100644
--- a/src/main.c
+++ b/src/main.c.autosave
@@ -552,6 +552,21 @@ static char *framebuffer_device_filename;
*/
static char *framebuffer_backlight_filename;
+/**
+ * Global option '-i' to invert backlight on/off values
+ */
+static int backlight_invert;
+
+/**
+ * Standard backlight on value
+ */
+static char backlight_on = '1';
+
+/**
+ * Standard backlight off value
+ */
+static char backlight_off = '0';
+
/**
* Name of the UART device with the MDB (i.e. /dev/ttyAMA0).
*/
@@ -712,7 +727,7 @@ show_qrcode (const char *uri)
QRinput_free (qri);
if (0 < qrDisplay.backlightfd)
- (void) write (qrDisplay.backlightfd, "1", 1);
+ (void) write (qrDisplay.backlightfd, &backlight_on, 1);
}
@@ -755,7 +770,7 @@ cleanup_payment (struct PaymentActivity *pa)
qrDisplay.var_info.xres * qrDisplay.var_info.yres
* sizeof (uint16_t));
if (0 < qrDisplay.backlightfd)
- (void) write (qrDisplay.backlightfd, "0", 1);
+ (void) write (qrDisplay.backlightfd, &backlight_off, 1);
#endif
GNUNET_free (pa->taler_pay_uri);
}
@@ -2422,7 +2437,12 @@ run (void *cls,
}
else
{
- (void) write (qrDisplay.backlightfd, "0", 1);
+ if (backlight_invert)
+ {
+ backlight_on = '0';
+ backlight_off = '1';
+ }
+ (void) write (qrDisplay.backlightfd, &backlight_off, 1);
}
}
else
@@ -2508,6 +2528,10 @@ main (int argc,
"disable-tty",
"disable all keyboard interactions (for running
from systemd)",
&disable_tty),
+ GNUNET_GETOPT_option_flag ('i',
+ "backlight-invert",
+ "invert the backlight on/off values (standard
on = 1)",
+ &backlight_invert),
GNUNET_GETOPT_OPTION_END
};
int have_tty;
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-taler-mdb] branch master updated: display backlight invert option flag,
gnunet <=