diff options
Diffstat (limited to 'src/irbox.c')
-rw-r--r-- | src/irbox.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/irbox.c b/src/irbox.c index 355a932..476ae9a 100644 --- a/src/irbox.c +++ b/src/irbox.c @@ -29,12 +29,13 @@ #include "timer.h" #include "ivy.h" #include "ivychannel.h" +#include "ivyloop.h" #include "irdev.h" #include "irtable.h" -#ifndef DEFAULT_DEVICE -#define DEFAULT_DEVICE "/dev/ttyS1" +#ifndef DEFAULT_IRBOX_DEVICE +#define DEFAULT_IRBOX_DEVICE "/dev/ttyS0" #endif #ifndef DEFAULT_IRBOX_DIR @@ -97,7 +98,7 @@ int main (int argc, char *argv[]) { int c; - const char* dev = DEFAULT_DEVICE; + const char* dev = 0; const char* bus = 0; static char app_name_buf [1024]; struct sigaction act; @@ -124,6 +125,12 @@ main (int argc, char *argv[]) app_name = app_name_buf; } + /* device */ + if (!dev) + dev = getenv ("IRBOX_DEVICE"); + if (!dev) + dev = DEFAULT_IRBOX_DEVICE; + /* data directory */ if (!data_dir_name) data_dir_name = getenv ("IRBOX_DIR"); |