projects
/
rigol
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
121b423
)
use uint32_t for vid/pid request
author
Michael Gernoth
<michael@gernoth.net>
Mon, 7 Jun 2010 22:59:01 +0000
(
00:59
+0200)
committer
Michael Gernoth
<michael@gernoth.net>
Mon, 7 Jun 2010 22:59:01 +0000
(
00:59
+0200)
usbtmc.c
patch
|
blob
|
blame
|
history
diff --git
a/usbtmc.c
b/usbtmc.c
index 419d100069b25111e57c7ab9b94abea9d81fe11f..6af5a13dc2c7a64d45e2404afd9ec18135b80551 100644
(file)
--- a/
usbtmc.c
+++ b/
usbtmc.c
@@
-215,7
+215,7
@@
void usbtmc_release(struct scope *sc)
//Initialize the scope.
struct scope* usbtmc_initscope(void) {
int r;
//Initialize the scope.
struct scope* usbtmc_initscope(void) {
int r;
- u
nsigned char buff[10]
;
+ u
int32_t vidpid
;
struct scope *sc;
/* Init libusb */
struct scope *sc;
/* Init libusb */
@@
-229,7
+229,7
@@
struct scope* usbtmc_initscope(void) {
usbtmc_claim(sc);
/* The following code isn't really necessary, the program works
OK without it too. */
usbtmc_claim(sc);
/* The following code isn't really necessary, the program works
OK without it too. */
- r=usb_control_msg(sc->usb.dev, 0xC8, 9, 0, 0, (char*)
buff
, 4, USB_TIMEOUT);
+ r=usb_control_msg(sc->usb.dev, 0xC8, 9, 0, 0, (char*)
&vidpid
, 4, USB_TIMEOUT);
usbtmc_release(sc);
if (r < 0) {
fprintf (stderr, "Error %d sending init message: %s\n",
usbtmc_release(sc);
if (r < 0) {
fprintf (stderr, "Error %d sending init message: %s\n",
@@
-237,8
+237,8
@@
struct scope* usbtmc_initscope(void) {
fprintf (stderr, "Do you have permission on the USB device?\n");
exit (1);
}
fprintf (stderr, "Do you have permission on the USB device?\n");
exit (1);
}
- if (LE32(
(*(uint32_t*)buff)
)!=0x40005dc) {
- fprintf(stderr,"Init: buff[%i]=%x\n",r,LE32(
(*(uint32_t*)buff)
));
+ if (LE32(
vidpid
)!=0x40005dc) {
+ fprintf(stderr,"Init: buff[%i]=%x\n",r,LE32(
vidpid
));
}
return sc;
}
}
return sc;
}
Impressum
,
Datenschutz