|
|
|
@ -23,6 +23,7 @@ respectively.
|
|
|
|
#include <string.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <usb.h> /* this is libusb */
|
|
|
|
#include <usb.h> /* this is libusb */
|
|
|
|
#include "opendevice.h" /* common code moved to separate module */
|
|
|
|
#include "opendevice.h" /* common code moved to separate module */
|
|
|
|
|
|
|
|
#include <arpa/inet.h> //for htons()
|
|
|
|
|
|
|
|
|
|
|
|
#include "../firmware/masterchip/usbdrv/usbconfig.h" /* device's VID/PID and names */
|
|
|
|
#include "../firmware/masterchip/usbdrv/usbconfig.h" /* device's VID/PID and names */
|
|
|
|
|
|
|
|
|
|
|
|
@ -101,6 +102,9 @@ int cnt, vid, pid;
|
|
|
|
opcode = atoi(argv[2]);
|
|
|
|
opcode = atoi(argv[2]);
|
|
|
|
addr = atoi(argv[3]);
|
|
|
|
addr = atoi(argv[3]);
|
|
|
|
value = atoi(argv[4]);
|
|
|
|
value = atoi(argv[4]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// x86 is little-endian, avr is big-endian
|
|
|
|
|
|
|
|
value = htons(value);
|
|
|
|
|
|
|
|
|
|
|
|
cnt = usb_control_msg(handle, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, opcode, addr, value, buffer, sizeof(buffer), 5000);
|
|
|
|
cnt = usb_control_msg(handle, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN, opcode, addr, value, buffer, sizeof(buffer), 5000);
|
|
|
|
if(cnt < 0){
|
|
|
|
if(cnt < 0){
|
|
|
|
|