That is crazy coincidental, I was just talking to a guy person that did the ADP keyboard thing, I was working with the pippin controller.
Haha, that was probably me.
This issues is with a UART. I'm well aware that USB for windows is 8ms apart, 2ms for linux and there are hacks for windows. Though I was under the impression the interrupts were every 1ms~ or so.
I'm on Linux (Ubuntu 12.04) and the packets to my device are only every 8ms (except when it sends several when updating the keyboard LEDs, and when first connecting the device). The USB interrupt is every 1ms, but no response is required between the 8ms packets.
And trying to run a 9600 UART maybe be tricky with that. So your pretty much saying I can disable them as long as the usb does not poll?
Here are hopefully the relevant parts of my code:
Code: Select all
uint8_t usbActivity;
int main( void )
{
...
for ( ;; )
{
// Wait for 8ms USB interrupt packet
usbActivity = false;
do {
usbPoll();
}
while ( !usbActivity );
// Approximate time of USB interrupt
unsigned frame_begin = clock();
// Give USB plenty of time to do any more packets for this 8ms frame
while ( clock_elapsed( frame_begin ) < CLOCK_US( 3500 ) )
usbPoll();
// If LEDs changed, do nothing for this frame as USB tends to be active throughout
uint8_t new_leds = keyboard_leds;
if ( old_leds != new_leds )
{
old_leds = new_leds;
continue;
}
// Poll ADB keyboard
cli();
... ~4ms
sei();
}
}
// Modification to usbdrv/asmcommon.inc
#define USB_CFG_ACTIVITY_FLAG 1
...
storeTokenAndReturn:
sts usbCurrentTok, token;[35]
#if ! USB_CFG_ACTIVITY_FLAG
doReturn:
#endif
doReturnNoActivity:
POP_STANDARD ;[37] 12...16 cycles
USB_LOAD_PENDING(YL) ;[49]
sbrc YL, USB_INTR_PENDING_BIT;[50] check whether data is already arriving
rjmp waitForJ ;[51] save the pops and pushes -- a new interrupt is already pending
sofError:
POP_RETI ;macro call
reti
#if USB_CFG_ACTIVITY_FLAG
doReturn:
ldi x1, 1
sts usbActivity, x1
rjmp doReturnNoActivity
#endif
handleData:
#if USB_CFG_CHECK_CRC
CRC_CLEANUP_AND_CHECK ; jumps to ignorePacket if CRC error
#endif
lds shift, usbCurrentTok;[18]
tst shift ;[20]
breq doReturnNoActivity ;[21]
...