summaryrefslogtreecommitdiffstats
path: root/cli.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-07-12 19:51:27 +0200
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-07-12 19:51:27 +0200
commit9a7ec0c7c063c86e0c2775bbf7fb485c691d9bb9 (patch)
treec7b4a4ca1008490d677b18a261743a0ff85cc9dc /cli.c
parente455f83ca2e4ee7c39837309a422732167994cbf (diff)
downloadipecamera-9a7ec0c7c063c86e0c2775bbf7fb485c691d9bb9.tar.gz
ipecamera-9a7ec0c7c063c86e0c2775bbf7fb485c691d9bb9.tar.bz2
ipecamera-9a7ec0c7c063c86e0c2775bbf7fb485c691d9bb9.tar.xz
ipecamera-9a7ec0c7c063c86e0c2775bbf7fb485c691d9bb9.zip
Few fixes
Diffstat (limited to 'cli.c')
-rw-r--r--cli.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/cli.c b/cli.c
index 7ba7332..8834865 100644
--- a/cli.c
+++ b/cli.c
@@ -357,9 +357,9 @@ int Benchmark(pcilib_t *handle, ACCESS_MODE mode, pcilib_dma_engine_addr_t dma,
max_size = BENCH_MAX_DMA_SIZE;
}
- for (size = min_size; size < max_size; size *= 4) {
- mbs_in = pcilib_benchmark_dma(handle, dma, addr, size, BENCHMARK_ITERATIONS, PCILIB_DMA_FROM_DEVICE);
- mbs_out = pcilib_benchmark_dma(handle, dma, addr, size, BENCHMARK_ITERATIONS, PCILIB_DMA_TO_DEVICE);
+ for (size = min_size; size < min_size + 1/*max_size*/; size *= 4) {
+ mbs_in = -1;//pcilib_benchmark_dma(handle, dma, addr, size, BENCHMARK_ITERATIONS, PCILIB_DMA_FROM_DEVICE);
+ mbs_out = -1;//pcilib_benchmark_dma(handle, dma, addr, size, BENCHMARK_ITERATIONS, PCILIB_DMA_TO_DEVICE);
mbs = pcilib_benchmark_dma(handle, dma, addr, size, BENCHMARK_ITERATIONS, PCILIB_DMA_BIDIRECTIONAL);
err = pcilib_wait_irq(handle, 0, 0, &irqs);
if (err) irqs = 0;
@@ -801,9 +801,17 @@ int WriteRegister(pcilib_t *handle, pcilib_model_description_t *model_info, cons
unsigned long val;
pcilib_register_value_t value;
-
- if ((!isnumber(*data))||(sscanf(*data, "%li", &val) != 1)) {
- Error("Can't parse data value (%s) is not valid decimal number", data[i]);
+
+ if (!isnumber(*data)) {
+ if (sscanf(*data, "%li", &val) != 1) {
+ Error("Can't parse data value (%s) is not valid decimal number", *data);
+ }
+ } else if (!isxnumber(*data)) {
+ if (sscanf(*data, "%lx", &val) != 1) {
+ Error("Can't parse data value (%s) is not valid decimal number", *data);
+ }
+ } else {
+ Error("Can't parse data value (%s) is not valid decimal number", *data);
}
value = val;