mirror of https://github.com/EspoTek/Labrador.git
Triple endpoints working in SW now
Added triple endpoint support for the Desktop interface. Should be possible to fix the one-packet-per-sample glitch easily, now. Even if it isn't, the device now only needs to reserve 768 bytes/frame, not 1023!!!!
This commit is contained in:
parent
880303ed09
commit
5769288a11
Binary file not shown.
Binary file not shown.
|
@ -41,12 +41,12 @@
|
|||
:10028000B0E201C01D92AC34B207E1F73ED00C944D
|
||||
:100290001715B6CEE0E8F6E08FE0808385E0848332
|
||||
:1002A000089508958091B420882319F080E090E0AB
|
||||
:1002B00002C08EEE92E042E551E06EEE72E08659A9
|
||||
:1002B00002C08EEE92E042E551E06AEF70E08659AE
|
||||
:1002C000994D46C708958091B420882319F08AEF8C
|
||||
:1002D00090E002C088EE93E043E651E06EEE72E0FB
|
||||
:1002D00090E002C088EE93E043E651E06AEF70E000
|
||||
:1002E0008659994D41C708958091B420882319F00B
|
||||
:1002F00084EF91E002C082EE94E044E751E06EEEBC
|
||||
:1003000072E08659994D3CC7089587E08093A2001A
|
||||
:1002F00084EF91E002C082EE94E044E751E06AEFBF
|
||||
:1003000070E08659994D3CC7089587E08093A2001C
|
||||
:10031000789431D6C6DF0E94B709DAD0FDD060E00C
|
||||
:1003200080E099D085D08CE079D03FD5F0D509D642
|
||||
:10033000B1DF50915622409157223091582220919E
|
||||
|
|
|
@ -15,17 +15,17 @@ Idx Name Size VMA LMA File off Algn
|
|||
CONTENTS, READONLY
|
||||
5 .debug_aranges 000004a8 00000000 00000000 00002bf0 2**3
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
6 .debug_info 0000a437 00000000 00000000 00003098 2**0
|
||||
6 .debug_info 0000a434 00000000 00000000 00003098 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
7 .debug_abbrev 00001b68 00000000 00000000 0000d4cf 2**0
|
||||
7 .debug_abbrev 00001b68 00000000 00000000 0000d4cc 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
8 .debug_line 00008998 00000000 00000000 0000f037 2**0
|
||||
8 .debug_line 00008998 00000000 00000000 0000f034 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
9 .debug_frame 000009f0 00000000 00000000 000179d0 2**2
|
||||
9 .debug_frame 000009f0 00000000 00000000 000179cc 2**2
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
10 .debug_str 0002f629 00000000 00000000 000183c0 2**0
|
||||
10 .debug_str 0002f629 00000000 00000000 000183bc 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
11 .debug_loc 000021d5 00000000 00000000 000479e9 2**0
|
||||
11 .debug_loc 000021d5 00000000 00000000 000479e5 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
12 .debug_ranges 000003d8 00000000 00000000 00049bc0 2**3
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
|
@ -406,7 +406,7 @@ void board_init(void)
|
|||
}
|
||||
|
||||
void iso_callback(udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_t ep){
|
||||
udi_vendor_iso_in_run((uint8_t *)&isoBuf[!b1_state * PACKET_SIZE], PACKET_SIZE, iso_callback);
|
||||
udi_vendor_iso_in_run((uint8_t *)&isoBuf[!b1_state * PACKET_SIZE], 250, iso_callback);
|
||||
2a4: 80 91 b4 20 lds r24, 0x20B4 ; 0x8020b4 <b1_state>
|
||||
2a8: 88 23 and r24, r24
|
||||
2aa: 19 f0 breq .+6 ; 0x2b2 <iso_callback+0xe>
|
||||
|
@ -417,8 +417,8 @@ void iso_callback(udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_t
|
|||
2b4: 92 e0 ldi r25, 0x02 ; 2
|
||||
2b6: 42 e5 ldi r20, 0x52 ; 82
|
||||
2b8: 51 e0 ldi r21, 0x01 ; 1
|
||||
2ba: 6e ee ldi r22, 0xEE ; 238
|
||||
2bc: 72 e0 ldi r23, 0x02 ; 2
|
||||
2ba: 6a ef ldi r22, 0xFA ; 250
|
||||
2bc: 70 e0 ldi r23, 0x00 ; 0
|
||||
2be: 86 59 subi r24, 0x96 ; 150
|
||||
2c0: 99 4d sbci r25, 0xD9 ; 217
|
||||
2c2: 46 c7 rjmp .+3724 ; 0x1150 <udi_vendor_iso_in_run>
|
||||
|
@ -430,7 +430,7 @@ void iso_callback(udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_t
|
|||
}
|
||||
|
||||
void iso_callback2(udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_t ep){
|
||||
udi_vendor_iso_in_run2((uint8_t *)&isoBuf[!b1_state * PACKET_SIZE + 250], PACKET_SIZE, iso_callback2);
|
||||
udi_vendor_iso_in_run2((uint8_t *)&isoBuf[!b1_state * PACKET_SIZE + 250], 250, iso_callback2);
|
||||
2c6: 80 91 b4 20 lds r24, 0x20B4 ; 0x8020b4 <b1_state>
|
||||
2ca: 88 23 and r24, r24
|
||||
2cc: 19 f0 breq .+6 ; 0x2d4 <iso_callback2+0xe>
|
||||
|
@ -441,8 +441,8 @@ void iso_callback2(udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_
|
|||
2d6: 93 e0 ldi r25, 0x03 ; 3
|
||||
2d8: 43 e6 ldi r20, 0x63 ; 99
|
||||
2da: 51 e0 ldi r21, 0x01 ; 1
|
||||
2dc: 6e ee ldi r22, 0xEE ; 238
|
||||
2de: 72 e0 ldi r23, 0x02 ; 2
|
||||
2dc: 6a ef ldi r22, 0xFA ; 250
|
||||
2de: 70 e0 ldi r23, 0x00 ; 0
|
||||
2e0: 86 59 subi r24, 0x96 ; 150
|
||||
2e2: 99 4d sbci r25, 0xD9 ; 217
|
||||
2e4: 41 c7 rjmp .+3714 ; 0x1168 <udi_vendor_iso_in_run2>
|
||||
|
@ -454,7 +454,7 @@ void iso_callback2(udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_
|
|||
}
|
||||
|
||||
void iso_callback3(udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_t ep){
|
||||
udi_vendor_iso_in_run3((uint8_t *)&isoBuf[!b1_state * PACKET_SIZE + 500], PACKET_SIZE, iso_callback3);
|
||||
udi_vendor_iso_in_run3((uint8_t *)&isoBuf[!b1_state * PACKET_SIZE + 500], 250, iso_callback3);
|
||||
2e8: 80 91 b4 20 lds r24, 0x20B4 ; 0x8020b4 <b1_state>
|
||||
2ec: 88 23 and r24, r24
|
||||
2ee: 19 f0 breq .+6 ; 0x2f6 <iso_callback3+0xe>
|
||||
|
@ -465,8 +465,8 @@ void iso_callback3(udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_
|
|||
2f8: 94 e0 ldi r25, 0x04 ; 4
|
||||
2fa: 44 e7 ldi r20, 0x74 ; 116
|
||||
2fc: 51 e0 ldi r21, 0x01 ; 1
|
||||
2fe: 6e ee ldi r22, 0xEE ; 238
|
||||
300: 72 e0 ldi r23, 0x02 ; 2
|
||||
2fe: 6a ef ldi r22, 0xFA ; 250
|
||||
300: 70 e0 ldi r23, 0x00 ; 0
|
||||
302: 86 59 subi r24, 0x96 ; 150
|
||||
304: 99 4d sbci r25, 0xD9 ; 217
|
||||
306: 3c c7 rjmp .+3704 ; 0x1180 <udi_vendor_iso_in_run3>
|
||||
|
|
|
@ -2625,24 +2625,24 @@ END GROUP
|
|||
.debug_pubnames
|
||||
*(.debug_pubnames)
|
||||
|
||||
.debug_info 0x00000000 0xa437
|
||||
.debug_info 0x00000000 0xa434
|
||||
*(.debug_info .gnu.linkonce.wi.*)
|
||||
.debug_info 0x00000000 0x290 src/tiny_dig.o
|
||||
.debug_info 0x00000290 0xff src/ASF/common/boards/user_board/init.o
|
||||
.debug_info 0x0000038f 0x986 src/main.o
|
||||
.debug_info 0x00000d15 0x9b6 src/tiny_adc.o
|
||||
.debug_info 0x000016cb 0x5f0 src/tiny_dac.o
|
||||
.debug_info 0x00001cbb 0x10d5 src/tiny_dma.o
|
||||
.debug_info 0x00002d90 0x17b4 src/tiny_timer.o
|
||||
.debug_info 0x00004544 0x4b2 src/tiny_uart.o
|
||||
.debug_info 0x000049f6 0xc3d src/ASF/common/services/clock/xmega/sysclk.o
|
||||
.debug_info 0x00005633 0x121 src/ASF/common/services/sleepmgr/xmega/sleepmgr.o
|
||||
.debug_info 0x00005754 0x638 src/ASF/common/services/usb/class/vendor/device/udi_vendor.o
|
||||
.debug_info 0x00005d8c 0x5fc src/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o
|
||||
.debug_info 0x00006388 0x214e src/ASF/common/services/usb/udc/udc.o
|
||||
.debug_info 0x000084d6 0x91 src/ASF/xmega/drivers/cpu/ccp.o
|
||||
.debug_info 0x00008567 0x91 src/ASF/xmega/drivers/nvm/nvm_asm.o
|
||||
.debug_info 0x000085f8 0x1e3f src/ASF/xmega/drivers/usb/usb_device.o
|
||||
.debug_info 0x0000038f 0x983 src/main.o
|
||||
.debug_info 0x00000d12 0x9b6 src/tiny_adc.o
|
||||
.debug_info 0x000016c8 0x5f0 src/tiny_dac.o
|
||||
.debug_info 0x00001cb8 0x10d5 src/tiny_dma.o
|
||||
.debug_info 0x00002d8d 0x17b4 src/tiny_timer.o
|
||||
.debug_info 0x00004541 0x4b2 src/tiny_uart.o
|
||||
.debug_info 0x000049f3 0xc3d src/ASF/common/services/clock/xmega/sysclk.o
|
||||
.debug_info 0x00005630 0x121 src/ASF/common/services/sleepmgr/xmega/sleepmgr.o
|
||||
.debug_info 0x00005751 0x638 src/ASF/common/services/usb/class/vendor/device/udi_vendor.o
|
||||
.debug_info 0x00005d89 0x5fc src/ASF/common/services/usb/class/vendor/device/udi_vendor_desc.o
|
||||
.debug_info 0x00006385 0x214e src/ASF/common/services/usb/udc/udc.o
|
||||
.debug_info 0x000084d3 0x91 src/ASF/xmega/drivers/cpu/ccp.o
|
||||
.debug_info 0x00008564 0x91 src/ASF/xmega/drivers/nvm/nvm_asm.o
|
||||
.debug_info 0x000085f5 0x1e3f src/ASF/xmega/drivers/usb/usb_device.o
|
||||
|
||||
.debug_abbrev 0x00000000 0x1b68
|
||||
*(.debug_abbrev)
|
||||
|
|
|
@ -42,12 +42,12 @@ S113027002C005900D92A23BB107D9F72CE2A2EB84
|
|||
S1130280B0E201C01D92AC34B207E1F73ED00C9449
|
||||
S11302901715B6CEE0E8F6E08FE0808385E084832E
|
||||
S11302A0089508958091B420882319F080E090E0A7
|
||||
S11302B002C08EEE92E042E551E06EEE72E08659A5
|
||||
S11302B002C08EEE92E042E551E06AEF70E08659AA
|
||||
S11302C0994D46C708958091B420882319F08AEF88
|
||||
S11302D090E002C088EE93E043E651E06EEE72E0F7
|
||||
S11302D090E002C088EE93E043E651E06AEF70E0FC
|
||||
S11302E08659994D41C708958091B420882319F007
|
||||
S11302F084EF91E002C082EE94E044E751E06EEEB8
|
||||
S113030072E08659994D3CC7089587E08093A20016
|
||||
S11302F084EF91E002C082EE94E044E751E06AEFBB
|
||||
S113030070E08659994D3CC7089587E08093A20018
|
||||
S1130310789431D6C6DF0E94B709DAD0FDD060E008
|
||||
S113032080E099D085D08CE079D03FD5F0D509D63E
|
||||
S1130330B1DF50915622409157223091582220919A
|
||||
|
|
Binary file not shown.
|
@ -135,19 +135,19 @@ bool main_setup_in_received(void)
|
|||
}
|
||||
|
||||
void iso_callback(udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_t ep){
|
||||
udi_vendor_iso_in_run((uint8_t *)&isoBuf[!b1_state * PACKET_SIZE], PACKET_SIZE, iso_callback);
|
||||
udi_vendor_iso_in_run((uint8_t *)&isoBuf[!b1_state * PACKET_SIZE], 250, iso_callback);
|
||||
//if((int8_t) USB.FIFORP > -16) udi_vendor_iso_in_run((uint8_t *)&isoBuf[0], PACKET_SIZE, iso_callback);
|
||||
return;
|
||||
}
|
||||
|
||||
void iso_callback2(udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_t ep){
|
||||
udi_vendor_iso_in_run2((uint8_t *)&isoBuf[!b1_state * PACKET_SIZE + 250], PACKET_SIZE, iso_callback2);
|
||||
udi_vendor_iso_in_run2((uint8_t *)&isoBuf[!b1_state * PACKET_SIZE + 250], 250, iso_callback2);
|
||||
//if((int8_t) USB.FIFORP > -16) udi_vendor_iso_in_run((uint8_t *)&isoBuf[0], PACKET_SIZE, iso_callback);
|
||||
return;
|
||||
}
|
||||
|
||||
void iso_callback3(udd_ep_status_t status, iram_size_t nb_transfered, udd_ep_id_t ep){
|
||||
udi_vendor_iso_in_run3((uint8_t *)&isoBuf[!b1_state * PACKET_SIZE + 500], PACKET_SIZE, iso_callback3);
|
||||
udi_vendor_iso_in_run3((uint8_t *)&isoBuf[!b1_state * PACKET_SIZE + 500], 250, iso_callback3);
|
||||
//if((int8_t) USB.FIFORP > -16) udi_vendor_iso_in_run((uint8_t *)&isoBuf[0], PACKET_SIZE, iso_callback);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.1.0, 2016-12-13T10:43:51. -->
|
||||
<!-- Written by QtCreator 4.1.0, 2016-12-15T09:37:41. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
@ -292,7 +292,7 @@
|
|||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">Labrador.pro</value>
|
||||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">C:/Users/Esposch/Documents/GitHub/Labrador/Desktop Interface/bin</value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default"></value>
|
||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
|
|
Binary file not shown.
|
@ -6,10 +6,15 @@ genericUsbDriver::genericUsbDriver(QWidget *parent) : QLabel(parent)
|
|||
this->hide();
|
||||
|
||||
//Double buffers are used to send the transfers to isoDriver. outBuffers and bufferLengths store the actual data from each transfer as well as length. They are read by isoDriver when it calls isoRead().
|
||||
outBuffers[0] = (unsigned char *) calloc(ISO_PACKET_SIZE*ISO_PACKETS_PER_CTX + 8, 1);
|
||||
outBuffers[1] = (unsigned char *) calloc(ISO_PACKET_SIZE*ISO_PACKETS_PER_CTX + 8, 1);
|
||||
outBuffers[0] = (unsigned char *) calloc(ISO_PACKET_SIZE*ISO_PACKETS_PER_CTX*NUM_ISO_ENDPOINTS + 8, 1);
|
||||
outBuffers[1] = (unsigned char *) calloc(ISO_PACKET_SIZE*ISO_PACKETS_PER_CTX*NUM_ISO_ENDPOINTS + 8, 1);
|
||||
bufferLengths[0] = 0;
|
||||
bufferLengths[1] = 0;
|
||||
|
||||
for(unsigned char k=0; k<NUM_ISO_ENDPOINTS; k++){
|
||||
pipeID[k] = 0x81+k;
|
||||
qDebug() << "pipeID" << k << "=" << pipeID[k];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -17,8 +17,9 @@
|
|||
#define ISO_PACKET_SIZE 250
|
||||
#define ISO_PACKETS_PER_CTX 17
|
||||
#define NUM_FUTURE_CTX 56
|
||||
#define MAX_OVERLAP NUM_FUTURE_CTX+1
|
||||
#define ISO_TIMER_PERIOD 16
|
||||
#define NUM_ISO_ENDPOINTS 3
|
||||
#define MAX_OVERLAP (NUM_FUTURE_CTX*NUM_ISO_ENDPOINTS + 1)
|
||||
|
||||
//genericUsbDriver handles the parts of the USB stack that are not platform-dependent.
|
||||
//It exists as a superclass for winUsbDriver (on Windows) or unixUsbDriver (on Linux)
|
||||
|
@ -51,7 +52,7 @@ protected:
|
|||
//Generic Vars
|
||||
bufferControl *bufferPtr = NULL;
|
||||
QTimer *psuTimer;
|
||||
unsigned char pipeID = 0x82;
|
||||
unsigned char pipeID[3];
|
||||
QTimer *isoTimer;
|
||||
unsigned char currentWriteBuffer = 0;
|
||||
unsigned long timerCount = 0;
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -28,14 +28,16 @@ winUsbDriver::~winUsbDriver(void){
|
|||
//Like any decent destructor, this just frees resources
|
||||
|
||||
qDebug() << "\n\nwinUsbDriver destructor ran!";
|
||||
for(int n=0;n<NUM_FUTURE_CTX;n++){
|
||||
IsoK_Free(isoCtx[n]);
|
||||
for (unsigned char k=0; k<NUM_ISO_ENDPOINTS; k++){
|
||||
for(int n=0;n<NUM_FUTURE_CTX;n++){
|
||||
IsoK_Free(isoCtx[k][n]);
|
||||
}
|
||||
for(int i=0;i<MAX_OVERLAP;i++){
|
||||
OvlK_Release(ovlkHandle[k][i]);
|
||||
}
|
||||
UsbK_FlushPipe(handle, pipeID[k]);
|
||||
UsbK_AbortPipe(handle, pipeID[k]);
|
||||
}
|
||||
for(int i=0;i<MAX_OVERLAP;i++){
|
||||
OvlK_Release(ovlkHandle[i]);
|
||||
}
|
||||
UsbK_FlushPipe(handle, pipeID);
|
||||
UsbK_AbortPipe(handle, pipeID);
|
||||
OvlK_Free(ovlPool);
|
||||
free(outBuffers[0]);
|
||||
free(outBuffers[1]);
|
||||
|
@ -152,41 +154,46 @@ unsigned char winUsbDriver::usbIsoInit(void){
|
|||
qDebug() << "OvlK_Init failed with error code" << errorCode;
|
||||
return 0;
|
||||
}
|
||||
success = UsbK_ResetPipe(handle, pipeID);
|
||||
if(!success){
|
||||
errorCode = GetLastError();
|
||||
qDebug() << "UsbK_ResetPipe failed with error code" << errorCode;
|
||||
return 0;
|
||||
for (unsigned char k=0;k<NUM_ISO_ENDPOINTS;k++){
|
||||
success = UsbK_ResetPipe(handle, pipeID[k]);
|
||||
if(!success){
|
||||
errorCode = GetLastError();
|
||||
qDebug() << "UsbK_ResetPipe failed with error code" << errorCode;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//Filling the transfer contexts
|
||||
for(n=0;n<NUM_FUTURE_CTX;n++){
|
||||
success = IsoK_Init(&isoCtx[n], ISO_PACKETS_PER_CTX, n*ISO_PACKETS_PER_CTX);
|
||||
if(!success){
|
||||
errorCode = GetLastError();
|
||||
qDebug() << "IsoK_Init failed with error code" << errorCode;
|
||||
qDebug() << "n =" << n;
|
||||
return 0;
|
||||
}
|
||||
for (unsigned char k=0;k<NUM_ISO_ENDPOINTS;k++){
|
||||
success = IsoK_Init(&isoCtx[k][n], ISO_PACKETS_PER_CTX, n*ISO_PACKETS_PER_CTX);
|
||||
if(!success){
|
||||
errorCode = GetLastError();
|
||||
qDebug() << "IsoK_Init failed with error code" << errorCode;
|
||||
qDebug() << "n =" << n;
|
||||
return 0;
|
||||
}
|
||||
|
||||
success = IsoK_SetPackets(isoCtx[n], ISO_PACKET_SIZE);
|
||||
if(!success){
|
||||
errorCode = GetLastError();
|
||||
qDebug() << "IsoK_SetPackets failed with error code" << errorCode;
|
||||
qDebug() << "n =" << n;
|
||||
return 0;
|
||||
}
|
||||
success = IsoK_SetPackets(isoCtx[k][n], ISO_PACKET_SIZE);
|
||||
if(!success){
|
||||
errorCode = GetLastError();
|
||||
qDebug() << "IsoK_SetPackets failed with error code" << errorCode;
|
||||
qDebug() << "n =" << n;
|
||||
return 0;
|
||||
}
|
||||
|
||||
success = OvlK_Acquire(&ovlkHandle[n], ovlPool);
|
||||
if(!success){
|
||||
errorCode = GetLastError();
|
||||
qDebug() << "OvlK_Acquire failed with error code" << errorCode;
|
||||
qDebug() << "n =" << n;
|
||||
return 0;
|
||||
}
|
||||
success = OvlK_Acquire(&ovlkHandle[k][n], ovlPool);
|
||||
if(!success){
|
||||
errorCode = GetLastError();
|
||||
qDebug() << "OvlK_Acquire failed with error code" << errorCode;
|
||||
qDebug() << "n =" << n;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//Sending the transfer requests
|
||||
success = UsbK_IsoReadPipe(handle, pipeID, dataBuffer[n], sizeof(dataBuffer[n]), (LPOVERLAPPED) ovlkHandle[n], isoCtx[n]);
|
||||
//Sending the transfer requests
|
||||
success = UsbK_IsoReadPipe(handle, pipeID[k], dataBuffer[k][n], sizeof(dataBuffer[k][n]), (LPOVERLAPPED) ovlkHandle[k][n], isoCtx[k][n]);
|
||||
qDebug() << "sizeof(dataBuffer[k][n]) = " << sizeof(dataBuffer[k][n]);
|
||||
}
|
||||
}
|
||||
|
||||
//Setting up isoTimer. This will call isoTimerTick every ISO_TIMER_PERIOD milliseconds.
|
||||
|
@ -223,23 +230,27 @@ void winUsbDriver::isoTimerTick(void){
|
|||
|
||||
//Getting earliest transfer number.
|
||||
for (n=0; n<NUM_FUTURE_CTX; n++){
|
||||
if(OvlK_IsComplete(ovlkHandle[n])){
|
||||
if(isoCtx[n]->StartFrame < minFrame){
|
||||
minFrame = isoCtx[n]->StartFrame;
|
||||
if(OvlK_IsComplete(ovlkHandle[0][n]) && OvlK_IsComplete(ovlkHandle[1][n]) && OvlK_IsComplete(ovlkHandle[2][n])){
|
||||
if(isoCtx[0][n]->StartFrame < minFrame){
|
||||
minFrame = isoCtx[0][n]->StartFrame;
|
||||
earliest = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//qDebug() << n << "is the earliest!";
|
||||
|
||||
if (earliest == MAX_OVERLAP){
|
||||
return;
|
||||
}
|
||||
|
||||
//Copy the tranfer data into buffer
|
||||
for(int i=0;i<isoCtx[earliest]->NumberOfPackets;i++){
|
||||
dataBufferOffset = isoCtx[earliest]->IsoPackets[i].Offset;
|
||||
memcpy(&(outBuffers[currentWriteBuffer][packetLength]), &dataBuffer[earliest][dataBufferOffset], isoCtx[earliest]->IsoPackets[i].Length);
|
||||
packetLength += isoCtx[earliest]->IsoPackets[i].Length;
|
||||
for(int i=0;i<isoCtx[0][earliest]->NumberOfPackets;i++){
|
||||
for(unsigned char k=0; k<NUM_ISO_ENDPOINTS;k++){
|
||||
dataBufferOffset = isoCtx[k][earliest]->IsoPackets[i].Offset;
|
||||
memcpy(&(outBuffers[currentWriteBuffer][packetLength]), &dataBuffer[k][earliest][dataBufferOffset], isoCtx[k][earliest]->IsoPackets[i].Length);
|
||||
packetLength += isoCtx[k][earliest]->IsoPackets[i].Length;
|
||||
}
|
||||
}
|
||||
|
||||
//Get the data for isoRead() ready and swap buffers
|
||||
|
@ -254,26 +265,29 @@ void winUsbDriver::isoTimerTick(void){
|
|||
killMe();
|
||||
}
|
||||
|
||||
UINT oldStart;
|
||||
//Setup transfer for resubmission
|
||||
UINT oldStart = isoCtx[earliest]->StartFrame;
|
||||
success = IsoK_ReUse(isoCtx[earliest]);
|
||||
if(!success){
|
||||
errorCode = GetLastError();
|
||||
qDebug() << "IsoK_Init failed with error code" << errorCode;
|
||||
qDebug() << "n =" << n;
|
||||
return;
|
||||
}
|
||||
isoCtx[earliest]->StartFrame = oldStart + ISO_PACKETS_PER_CTX*NUM_FUTURE_CTX;
|
||||
for(unsigned char k=0; k<NUM_ISO_ENDPOINTS; k++){
|
||||
oldStart = isoCtx[k][earliest]->StartFrame;
|
||||
success = IsoK_ReUse(isoCtx[k][earliest]);
|
||||
if(!success){
|
||||
errorCode = GetLastError();
|
||||
qDebug() << "IsoK_Init failed with error code" << errorCode;
|
||||
qDebug() << "n =" << n;
|
||||
return;
|
||||
}
|
||||
isoCtx[k][earliest]->StartFrame = oldStart + ISO_PACKETS_PER_CTX*NUM_FUTURE_CTX;
|
||||
|
||||
success = OvlK_ReUse(ovlkHandle[earliest]);
|
||||
if(!success){
|
||||
errorCode = GetLastError();
|
||||
qDebug() << "OvlK_ReUse failed with error code" << errorCode;
|
||||
qDebug() << "n =" << n;
|
||||
return;
|
||||
success = OvlK_ReUse(ovlkHandle[k][earliest]);
|
||||
if(!success){
|
||||
errorCode = GetLastError();
|
||||
qDebug() << "OvlK_ReUse failed with error code" << errorCode;
|
||||
qDebug() << "n =" << n;
|
||||
return;
|
||||
}
|
||||
//Resubmit the transfer
|
||||
success = UsbK_IsoReadPipe(handle, pipeID[k], dataBuffer[k][earliest], sizeof(dataBuffer[k][earliest]), (LPOVERLAPPED) ovlkHandle[k][earliest], isoCtx[k][earliest]);
|
||||
}
|
||||
//Resubmit the transfer
|
||||
success = UsbK_IsoReadPipe(handle, pipeID, dataBuffer[earliest], sizeof(dataBuffer[earliest]), (LPOVERLAPPED) ovlkHandle[earliest], isoCtx[earliest]);
|
||||
|
||||
//Signal to isoDriver that it can draw a new frame.
|
||||
upTick();
|
||||
|
|
|
@ -25,10 +25,10 @@ private:
|
|||
//USB Vars
|
||||
KUSB_HANDLE handle = NULL;
|
||||
//USBIso Vars
|
||||
PKISO_CONTEXT isoCtx[NUM_FUTURE_CTX];
|
||||
KOVL_HANDLE ovlkHandle[NUM_FUTURE_CTX];
|
||||
PKISO_CONTEXT isoCtx[NUM_ISO_ENDPOINTS][NUM_FUTURE_CTX];
|
||||
KOVL_HANDLE ovlkHandle[NUM_ISO_ENDPOINTS][NUM_FUTURE_CTX];
|
||||
KOVL_POOL_HANDLE ovlPool;
|
||||
unsigned char dataBuffer[NUM_FUTURE_CTX][ISO_PACKET_SIZE*ISO_PACKETS_PER_CTX];
|
||||
unsigned char dataBuffer[NUM_ISO_ENDPOINTS][NUM_FUTURE_CTX][ISO_PACKET_SIZE*ISO_PACKETS_PER_CTX];
|
||||
//Generic Functions
|
||||
unsigned char usbInit(unsigned long VIDin, unsigned long PIDin);
|
||||
unsigned char usbIsoInit(void);
|
||||
|
|
|
@ -14,26 +14,26 @@
|
|||
|
||||
(page A4)
|
||||
(layers
|
||||
(0 F.Cu signal)
|
||||
(31 B.Cu signal)
|
||||
(32 B.Adhes user)
|
||||
(33 F.Adhes user)
|
||||
(34 B.Paste user)
|
||||
(0 F.Cu signal hide)
|
||||
(31 B.Cu signal hide)
|
||||
(32 B.Adhes user hide)
|
||||
(33 F.Adhes user hide)
|
||||
(34 B.Paste user hide)
|
||||
(35 F.Paste user)
|
||||
(36 B.SilkS user hide)
|
||||
(37 F.SilkS user hide)
|
||||
(38 B.Mask user)
|
||||
(39 F.Mask user)
|
||||
(40 Dwgs.User user hide)
|
||||
(38 B.Mask user hide)
|
||||
(39 F.Mask user hide)
|
||||
(40 Dwgs.User user)
|
||||
(41 Cmts.User user hide)
|
||||
(42 Eco1.User user hide)
|
||||
(43 Eco2.User user hide)
|
||||
(44 Edge.Cuts user)
|
||||
(45 Margin user)
|
||||
(46 B.CrtYd user)
|
||||
(47 F.CrtYd user)
|
||||
(48 B.Fab user)
|
||||
(49 F.Fab user)
|
||||
(44 Edge.Cuts user hide)
|
||||
(45 Margin user hide)
|
||||
(46 B.CrtYd user hide)
|
||||
(47 F.CrtYd user hide)
|
||||
(48 B.Fab user hide)
|
||||
(49 F.Fab user hide)
|
||||
)
|
||||
|
||||
(setup
|
||||
|
|
Loading…
Reference in New Issue