| 13,6 → 13,8 |
| #endif |
| |
| #include "wusbvme_dll.h" |
| #include <userint.h> |
| #include <utility.h> |
| |
| usb_dev_handle *WUSB_udev; |
| |
| 69,16 → 71,21 |
| |
| |
| void _VI_FUNC WIENER_VMUSB_load (const char* module_path) { |
| |
| if (module_path == NULL) { |
| DLLHandle = LoadLibrary("c:\\Windows\\system32\\libxxusb.dll"); |
| } else { |
| DLLHandle = LoadLibrary(module_path); |
| printf("Module Path %s\n", module_path); |
| } |
| if (!DLLHandle) { |
| printf ("\n\nFailed to Open libxxusb.dll \n"); |
| printf ("\n\nFailed to Open libxxusb.dll \n"); |
| printf("LastError 0x%x\n",GetLastError() ); |
| MessagePopup ("ERROR", "Failed to load libxxusb.dll "); |
| return; |
| } |
| } else { |
| printf ("\n\nSuccesfully Opened libxxusb.dll \n"); |
| } |
| if (!(xxusb_register_read_Ptr = (void *) GetProcAddress(DLLHandle,"xxusb_register_read"))) exit(1); |
| if (!(xxusb_stack_read_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_stack_read"))) exit(1); |
| if (!(xxusb_stack_write_Ptr = (void*) GetProcAddress(DLLHandle,"xxusb_stack_write"))) exit(1); |
| 120,9 → 127,9 |
| |
| xxusb_device_type devices[100]; |
| struct usb_device *dev; |
| if (serial != NULL) |
| if (serial != NULL) { |
| WUSB_udev = xxusb_serial_open((char *) serial); |
| else { |
| } else { |
| //Find XX_USB devices and open the first one found |
| xxusb_devices_find(devices); |
| dev = devices[0].usbdev; |
| 157,7 → 164,7 |
| WIENER_VMUSB_StackInit(); |
| } |
| |
| int WIENER_VMUSB_StackGetUInt16(int maxn, uint16_t *stack) { |
| int WIENER_VMUSB_StackGetUint16(int maxn, uint16_t *stack) { |
| int i; |
| uint16_t * u16Stack = (uint16_t *) fStack; |
| for (i=0; i< fStackSize*2; i++) { |
| 167,7 → 174,7 |
| return fStackSize*2; |
| } |
| |
| int WIENER_VMUSB_StackGetUInt32(int maxn, uint32_t *stack) { |
| int WIENER_VMUSB_StackGetUint32(int maxn, uint32_t *stack) { |
| int i; |
| uint16_t * u16Stack = (uint16_t *) fStack; |
| for (i=0; i< fStackSize*2; i++) { |
| 235,7 → 242,7 |
| } |
| uint16_t * exstack = (uint16_t *) wusbcc_stack; |
| exstack[0]=0; |
| nb = WIENER_VMUSB_StackGetUInt16(MAXSTACKSIZE, &exstack[1] ); |
| nb = WIENER_VMUSB_StackGetUint16(MAXSTACKSIZE, &exstack[1] ); |
| //printf("WUSBXX_stack_execute stack size %d\n", nb); |
| //WIENER_VMUSB_StackPrint(); |
| nb = xxusb_longstack_execute (dev, exstack, nb, 1000); |
| 248,6 → 255,8 |
| |
| |
| |
| |
| |
| #ifndef VME_D32 |
| |
| #define VME_D8 0x1 |