From 1a32ec046dbb85823eeb2fb965a594614473d719 Mon Sep 17 00:00:00 2001 From: Thara Gopinath Date: Fri, 14 Jul 2017 13:15:48 -0400 Subject: Fix the numbering of display options. The ordering of the display options was not matching with the order of the windows defined in display.h causing GPIO and CLOCK display to seg fault/not work. This patch fixes this issue. Signed-off-by: Thara Gopinath --- display.c | 2 +- powerdebug.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/display.c b/display.c index 6b2404e..5665ed5 100644 --- a/display.c +++ b/display.c @@ -557,7 +557,7 @@ int display_init(struct powerdebug_options *options) int i, maxx, maxy; size_t array_size = sizeof(windata) / sizeof(windata[0]); - current_win = 1 << (ffs(options->flags & DEFAULT_OPTION) - 1); + current_win = (ffs(options->flags & DEFAULT_OPTION) - 1); signal(SIGWINCH, sigwinch_handler); diff --git a/powerdebug.h b/powerdebug.h index 7cf8220..a8073a6 100644 --- a/powerdebug.h +++ b/powerdebug.h @@ -21,9 +21,9 @@ #define VERSION "0.7.3" -#define REGULATOR_OPTION 0x01 -#define SENSOR_OPTION 0x02 -#define CLOCK_OPTION 0x04 +#define CLOCK_OPTION 0x01 +#define REGULATOR_OPTION 0x02 +#define SENSOR_OPTION 0x04 #define GPIO_OPTION 0x08 #define VERBOSE_OPTION 0x1000 -- cgit v1.2.3