Skip to content

Commit

Permalink
Allow ../led.cfg to work too.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhite66 committed Apr 5, 2012
1 parent a1d26be commit 46d0215
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions led.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#define LED_CFG_FILE "led.cfg"
#define ALT_LED_CFG_FILE "../led.cfg"

#define MAX_BRIGHT 0xCC
#define MAX_RGB 0xF
Expand Down
3 changes: 2 additions & 1 deletion libled.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ serial_t *led_init(void)
ser->confirm_every = (64 / 4) - 4;

config_init(&ser->config);
config_read_file(&ser->config, LED_CFG_FILE);
if (config_read_file(&ser->config, LED_CFG_FILE) == CONFIG_FALSE)
config_read_file(&ser->config, ALT_LED_CFG_FILE);

config_lookup_int(&ser->config, "display/height", &ser->height);
config_lookup_int(&ser->config, "display/width", &ser->width);
Expand Down

0 comments on commit 46d0215

Please sign in to comment.