From 0744c2015b73fa6319cb486fca79cc2c83373985 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 1 Jan 1970 09:37:39 +0900 Subject: show FW version and controller type (BB or OL) at startup --- bus.c | 8 ++++++++ device-functions.c | 2 +- flash.c | 4 ---- globals.h | 4 ++-- instr-daemon.c | 3 ++- menus.c | 3 +-- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/bus.c b/bus.c index 2e3bf60..ee0f8cb 100644 --- a/bus.c +++ b/bus.c @@ -17,6 +17,7 @@ #include #include "globals.h" #include "bus.h" +#include "version.h" #define GPIO_SYSFSPATH "/sys/class/gpio" #define GPIO_EXPORTNODE "export" @@ -356,6 +357,13 @@ void bus_init() globals.HWDetect.beaglebone = util_is_beaglebone(); globals.HWDetect.olimex = util_is_olimex(); + strcpy(globals.HWDetect.firmware,FW_VERSION); + if (globals.HWDetect.beaglebone) { + strcat(globals.HWDetect.firmware,"BB"); + } else if (globals.HWDetect.olimex) { + strcat(globals.HWDetect.firmware,"OL"); + } + globals.HWDetect.has_i2c = globals.HWDetect.beaglebone || globals.HWDetect.olimex; globals.HWDetect.has_gpmc = globals.HWDetect.beaglebone || globals.HWDetect.olimex; globals.HWDetect.has_gpio = globals.HWDetect.beaglebone || globals.HWDetect.olimex; diff --git a/device-functions.c b/device-functions.c index 98b51d5..997390f 100644 --- a/device-functions.c +++ b/device-functions.c @@ -65,7 +65,7 @@ void idn_string(gchar** response) *response = g_strdup_printf ("AVTECH ELECTROSYSTEMS,%s,SN:%s,v%s", globals.Flash.model_num, globals.Flash.serial_num, - FW_VERSION); + globals.HWDetect.firmware); } diff --git a/flash.c b/flash.c index ab5ebb2..83ed642 100644 --- a/flash.c +++ b/flash.c @@ -1,7 +1,6 @@ #include "globals.h" #include "lcd.h" #include "i2c.h" -#include "version.h" #include "flash.h" #include "device-functions.h" #include @@ -519,9 +518,6 @@ static void initFlashValues(FlashStruct *mem) mem->pcb116c_mon=1; /* more recent ADC, different reading code */ mem->warn_even_if_output_off=0; - strcpy(mem->spec_func_lib,"Not used"); - strcpy(mem->firmware,FW_VERSION); - mem->enable_avrq_extra_ampls=0; for (i=0; i