# HG changeset patch # User Daniele Nicolodi # Date 1393004549 -3600 # Node ID c96f5f64c946f5e8ed776eacd97f2a89bf2dace5 # Parent 8faada7e4faffb782f9516ff49dd511256be91cd Armonize configuration file path construction in KK data provider diff -r 8faada7e4faf -r c96f5f64c946 kk-data-provider.c --- a/kk-data-provider.c Fri Feb 21 18:42:16 2014 +0100 +++ b/kk-data-provider.c Fri Feb 21 18:42:29 2014 +0100 @@ -6,10 +6,10 @@ #include #include +#include "config.h" #include "data-provider.h" #include "KKFX80E.h" -#define CONFIGFILE "FXAnalyse.ini" #define DEFAULT_PORT "COM4:115200" #define DEFAULT_NCHAN 4 #define TIMEOUT 1 /* seconds */ @@ -28,22 +28,20 @@ /* get main thread id to post messages to it */ mainThreadId = CmtGetMainThreadID(); - /* construct configuration file path */ - char pathname[MAX_PATHNAME_LEN]; - char project[MAX_PATHNAME_LEN]; - GetProjectDir(project); - MakePathname(project, CONFIGFILE, pathname); + /* configuration file path */ + char path[MAX_PATHNAME_LEN]; + GetIniFilePath(path); /* load configuration file */ IniText configuration = Ini_New(TRUE); - Ini_ReadFromFile(configuration, pathname); + Ini_ReadFromFile(configuration, path); /* get serial port name configuration */ rv = Ini_GetStringIntoBuffer(configuration, "KK", "port", port, sizeof(port)); if (! rv) strncpy(port, DEFAULT_PORT, sizeof(port)); - /* channels number */ + /* channel number */ rv = Ini_GetInt(configuration, "KK", "nchan", &nchan); if (! rv) nchan = DEFAULT_NCHAN;