diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-10-21 03:44:27 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-10-21 03:44:27 +0200 |
commit | 32bd82e4b4748cbe7b4734030dfb135feab4dffc (patch) | |
tree | 5a4a6c77d2f51f4d8e9081961b31bb6b53c64948 /cli.c | |
parent | b407c19d68509af786ed13fb22e66bebbf73c0d8 (diff) | |
download | ipecamera-32bd82e4b4748cbe7b4734030dfb135feab4dffc.tar.gz ipecamera-32bd82e4b4748cbe7b4734030dfb135feab4dffc.tar.bz2 ipecamera-32bd82e4b4748cbe7b4734030dfb135feab4dffc.tar.xz ipecamera-32bd82e4b4748cbe7b4734030dfb135feab4dffc.zip |
Accept short addresses for IPECamera FPGA registers
Diffstat (limited to 'cli.c')
-rw-r--r-- | cli.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1537,7 +1537,14 @@ int main(int argc, char **argv) { if ((start >= ranges[i].start)&&(start <= ranges[i].end)) break; // register access in plain mode - if (ranges[i].start != ranges[i].end) ++mode; + if (ranges[i].start != ranges[i].end) { + pcilib_register_bank_t regbank = pcilib_find_bank_by_addr(handle, ranges[i].bank); + if (regbank == PCILIB_REGISTER_BANK_INVALID) Error("Configuration error: register bank specified in the address range is not found"); + + bank = model_info->banks[regbank].name; + start += ranges[i].addr_shift; + ++mode; + } } } else { if (pcilib_find_register(handle, bank, addr) == PCILIB_REGISTER_INVALID) { |