diff options
author | Christian König <chrissi@zweiundvierzig.(none)> | 2010-05-19 23:35:20 +0200 |
---|---|---|
committer | Christian König <chrissi@zweiundvierzig.(none)> | 2010-05-19 23:35:20 +0200 |
commit | 95680e20f39d6826243c78b775abde09250a3306 (patch) | |
tree | 69a330b4197a40bd2b1d597415a70080582c6e1b | |
parent | 865d9841520eb325b337fe3b33f1b726088e1fcc (diff) |
Fix hardware device parameter
-rw-r--r-- | cmd/cec.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -20,11 +20,9 @@ struct CEC_Device device; -static const char* hw_device = "/dev/i2c-1"; - const char* usage = "Usage: %s [commands]\n" -"-msp430 <device> : use device as i2c device\n" +" -msp430 <device> : use device as i2c device\n" " -phys <?.?.?.?> : use physical addr ?.?.?.?\n" " -src <addr> : use specified logical source addr\n" " -addr <device type> : run logical addr allocation algo\n" @@ -157,10 +155,10 @@ void dump() } } -void init_device() +void init_device(const char* hardware) { CEC_Init_Device(&device); - device.hardware = MSP430_Open_Hardware(hw_device); + device.hardware = MSP430_Open_Hardware(hardware); device.func_debug = debug; } @@ -174,12 +172,10 @@ int main(int argc, const char* argv[]) return 1; } - init_device(); - for(i=1; i<argc; i++) { if (!strncmp("-msp430", argv[i], 8)) { - hw_device = argv[++i]; + init_device(argv[++i]); } else if (!strncmp("-phys", argv[i], 6)) { device.physical_address = parse_physical(&i, argc, argv); |