const char *logfn = NULL;
uint8_t *tas_data = NULL;
int use_vsync = 0; // frame increment on vsync
+ int no_start_seq = 0;
int tas_skip = 0;
int enable_sent = 0;
int abort_sent = 0;
case 'v':
use_vsync = 1;
continue;
+ case 'n':
+ no_start_seq = 1;
+ continue;
default:
fprintf(stderr, "bad arg: %s\n", argv[i]);
return 1;
pkt_out.enable.stream_to = (tas_data != NULL);
pkt_out.enable.stream_from = (outf != NULL);
pkt_out.enable.use_readinc = !use_vsync;
+ pkt_out.enable.no_start_seq = no_start_seq;
ret = submit_urb(dev.fd, &urb[URB_DATA_OUT], dev.ifaces[0].ep_out,
&pkt_out, sizeof(pkt_out));
g.frame_cnt++;
}
+static void choose_isrs(void)
+{
+ if (g.stream_enable_to) {
+ if (g.use_readinc) {
+ attachInterruptVector(IRQ_PORTB, portb_isr_do_to_inc);
+ attachInterruptVector(IRQ_PORTC, portc_isr_nop);
+ }
+ else {
+ attachInterruptVector(IRQ_PORTB, portb_isr_do_to);
+ attachInterruptVector(IRQ_PORTC, portc_isr_frameinc);
+ }
+ }
+ else if (g.stream_enable_from) {
+ g.use_pending = 1;
+ if (g.use_readinc) {
+ attachInterruptVector(IRQ_PORTB,
+ portb_isr_fixed_do_from);
+ attachInterruptVector(IRQ_PORTC, portc_isr_nop);
+ }
+ else {
+ attachInterruptVector(IRQ_PORTB, portb_isr_fixed);
+ attachInterruptVector(IRQ_PORTC,
+ portc_isr_frameinc_do_from);
+ }
+ }
+}
+
static void udelay(uint32_t us)
{
uint32_t start = micros();
}
__disable_irq();
+ choose_isrs();
g.stream_started = 1;
- if (g.stream_enable_to) {
- if (g.use_readinc) {
- attachInterruptVector(IRQ_PORTB, portb_isr_do_to_inc);
- attachInterruptVector(IRQ_PORTC, portc_isr_nop);
- }
- else {
- attachInterruptVector(IRQ_PORTB, portb_isr_do_to);
- attachInterruptVector(IRQ_PORTC, portc_isr_frameinc);
- }
- }
- else if (g.stream_enable_from) {
- g.use_pending = 1;
- if (g.use_readinc) {
- attachInterruptVector(IRQ_PORTB,
- portb_isr_fixed_do_from);
- attachInterruptVector(IRQ_PORTC, portc_isr_nop);
- }
- else {
- attachInterruptVector(IRQ_PORTB, portb_isr_fixed);
- attachInterruptVector(IRQ_PORTC,
- portc_isr_frameinc_do_from);
- }
- }
__enable_irq();
}
g.stream_enable_to = pkt->enable.stream_to;
g.stream_enable_from = pkt->enable.stream_from;
g.use_readinc = pkt->enable.use_readinc;
+ if (pkt->enable.no_start_seq) {
+ GPIOD_PDOR = 0x3f;
+ choose_isrs();
+ g.stream_started = 1;
+ }
__enable_irq();
break;
case PKT_STREAM_ABORT: