Skip to content

Commit 9eed0c6

Browse files
author
Sebastian Pichelhofer
committed
enabled black coloumns and keep exposure time feature
1 parent 747336c commit 9eed0c6

File tree

1 file changed

+19
-7
lines changed
  • software/sensor_tools/snap

1 file changed

+19
-7
lines changed

software/sensor_tools/snap/snap.c

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**********************************************************************
22
** snap.c
33
** Control Image Capture and Data Dump
4-
** Version 1.11
4+
** Version 1.12
55
**
66
** SPDX-FileCopyrightText: © 2013 Herbert Poetzl <herbert@13thfloor.at>
77
** SPDX-License-Identifier: GPL-2.0-or-later
@@ -26,7 +26,7 @@
2626
#include "cmv_reg.h"
2727
#include "scn_reg.h"
2828

29-
#define VERSION "cmv_snap3 V1.11"
29+
#define VERSION "cmv_snap3 V1.12"
3030

3131
static char *cmd_name = NULL;
3232

@@ -69,17 +69,19 @@ static bool out_12 = false;
6969
static bool out_16 = true;
7070
static bool out_buf = false;
7171

72-
// static bool opt_bcols = false;
72+
static bool opt_bcols = false;
7373
static bool opt_tpat = false;
7474
static bool opt_dumpr = false;
7575
static bool opt_prime = false;
7676
static bool opt_zero = false;
77+
static bool opt_keep = false;
7778

7879
static uint16_t reg82;
7980
// static uint16_t reg83;
8081
// static uint16_t reg84;
8182
static uint16_t reg85;
8283
// static uint16_t reg86;
84+
static uint16_t reg89;
8385

8486

8587
double lvds = 250e6;
@@ -566,7 +568,7 @@ static void cmv_sem_init_and_lock()
566568
atexit(cmv_sem_unlock_and_cleanup);
567569
}
568570

569-
#define OPTIONS "h82dbprtze:v:s:S:P:R:"
571+
#define OPTIONS "h82dbprtzEe:v:s:S:P:R:"
570572

571573
int main(int argc, char *argv[])
572574
{
@@ -594,6 +596,7 @@ int main(int argc, char *argv[])
594596
"-r dump sensor registers\n"
595597
"-t enable cmv test pattern\n"
596598
"-z produce no data output\n"
599+
"-E keep current exposure\n"
597600
// "-n <num> number of frames\n"
598601
"-e <exp> exposure times\n"
599602
"-v <exp> exposure voltages\n"
@@ -617,7 +620,7 @@ int main(int argc, char *argv[])
617620
out_buf = true;
618621
break;
619622
case 'b':
620-
// opt_bcols = true;
623+
opt_bcols = true;
621624
break;
622625
case 'p':
623626
opt_prime = true;
@@ -631,6 +634,9 @@ int main(int argc, char *argv[])
631634
case 'z':
632635
opt_zero = true;
633636
break;
637+
case 'E':
638+
opt_keep = true;
639+
break;
634640
/* case 'n':
635641
num_frames = argtoll(optarg, NULL, NULL);
636642
break; */
@@ -749,7 +755,7 @@ int main(int argc, char *argv[])
749755
}
750756

751757

752-
if (num_times == 0)
758+
if ((num_times == 0) && !opt_keep)
753759
goto regs;
754760

755761
if (opt_prime) {
@@ -765,6 +771,12 @@ int main(int argc, char *argv[])
765771

766772
reg82 = get_cmv_reg(82);
767773
reg85 = get_cmv_reg(85);
774+
reg89 = get_cmv_reg(89);
775+
776+
if (opt_bcols && ((reg89 & 0x8000) == 0))
777+
set_cmv_reg(89, reg89 | 0x8000);
778+
if (!opt_bcols && ((reg89 & 0x8000) != 0))
779+
set_cmv_reg(89, reg89 & ~0x8000);
768780

769781

770782
if (num_times > 2) {
@@ -828,7 +840,7 @@ int main(int argc, char *argv[])
828840
reg82 = get_cmv_reg(82);
829841
reg85 = get_cmv_reg(85);
830842

831-
if (num_times == 0)
843+
if ((num_times == 0) && !opt_keep)
832844
goto skip;
833845

834846
exp_time[0] = get_cmv_reg(72) << 16 | get_cmv_reg(71);

0 commit comments

Comments
 (0)