Skip to content

Commit

Permalink
fx2 firmware: Temp commit as both webcam and serial work.
Browse files Browse the repository at this point in the history
Lots of quirks:
 * First time starting the UVC webcam, it won't start while serial port is
   connected. After that, its mostly fine.

 * [  601.755124] xhci_hcd 0000:08:00.0: xHCI xhci_drop_endpoint called with disabled ep ffff880fe4b89400
  • Loading branch information
mithro committed Nov 2, 2015
1 parent e9a936a commit 48477f3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
20 changes: 15 additions & 5 deletions firmware/fx2/app.c
Expand Up @@ -191,21 +191,31 @@ void TD_Init(void) // Called once at startup
* | 1 | 1 | Triple |
* |______|______|___________|
*/

// Used by the video data
SYNCDELAY; EP6CFG = 0xDA; // Activate, IN Direction, ISO Type, 1024 bytes Size, Double buffered
SYNCDELAY; EP8CFG = 0x00; // Disable Endpoint 8

// 0 INFM1 OEP1 AUTOOUT AUTOIN ZEROLENIN 0 WORDWIDE
SYNCDELAY; EP2FIFOCFG = 0x00;
SYNCDELAY; EP4FIFOCFG = 0x00;
SYNCDELAY; EP6FIFOCFG = 0x0C;
SYNCDELAY; EP8FIFOCFG = 0x00;

//SYNCDELAY; EP4AUTOINLENH = 0x02;
//SYNCDELAY; EP4AUTOINLENL = 0x00;

SYNCDELAY; EP6AUTOINLENH = 0x04;
SYNCDELAY; EP6AUTOINLENL = 0x00;

SYNCDELAY; EP8FIFOCFG = 0x00;

//SYNCDELAY; REVCTL = 0x03; // REVCTL.0 and REVCTL.1 set to 1
//SYNCDELAY; REVCTL = 0x00; // REVCTL.0 and REVCTL.1 set to 1
SYNCDELAY; REVCTL = 0x00; // REVCTL.0 and REVCTL.1 set to 1
RESETFIFOS();
SYNCDELAY; FIFORESET = 0x80; // Reset the FIFO
SYNCDELAY; FIFORESET = 0x82;
SYNCDELAY; FIFORESET = 0x84;
SYNCDELAY; FIFORESET = 0x86;
SYNCDELAY; FIFORESET = 0x00;
//RESETFIFOS();
}

void TD_Poll(void) // Called repeatedly while the device is idle
Expand Down
13 changes: 10 additions & 3 deletions firmware/fx2/uvc.c
Expand Up @@ -143,12 +143,19 @@ BOOL handle_set_interface(BYTE ifc, BYTE alt_ifc)
CDC_H2D_EP(BCL)=0X80;
SYNCDELAY;
CDC_D2H_RESET(FIFO);
return TRUE;
} else {
return FALSE;
}

if (AlternateSetting == 1) {
// reset UVC fifo
SYNCDELAY; FIFORESET = 0x80;
SYNCDELAY; FIFORESET = 0x06;
SYNCDELAY; FIFORESET = 0x00;
}

return TRUE;
}


BOOL handle_get_descriptor() {
return FALSE;
}

0 comments on commit 48477f3

Please sign in to comment.