# HG changeset patch # User aaronwolfe # Date 1264297894 0 # Node ID 8476556e5f0ce275f42a8ab838feb7905460e79e # Parent e454c42a134b6640f942d055ef509f6dbb75c4d3 dynamic ISR/poll frequency diff -r e454c42a134b -r 8476556e5f0c level1/modules/dw3.asm --- a/level1/modules/dw3.asm Sun Jan 24 00:50:58 2010 +0000 +++ b/level1/modules/dw3.asm Sun Jan 24 01:51:34 2010 +0000 @@ -11,7 +11,10 @@ * * 2 2010/01/20 Boisy G. Pitre * Added support for DWNet - +* +* 3 2010/01/23 Aaron A. Wolfe +* Added dynamic polling frequency +* nam DW3 ttl DriveWire 3 Low Level Subroutine Module @@ -31,6 +34,17 @@ * Default time packet DefTime fcb 109,12,31,23,59,59 +* for dynamic poll frequency, number of ticks between firing poller +* speed 1 = interactive (typing) +PollSpd1 fcb 3 +* speed 2 = bulk transfer +PollSpd2 fcb 6 +* speed 3 = idle +PollSpd3 fcb 40 +* X pollidle -> drop to next slower rate +PollIdle fcb 60 + + name fcs /dw3/ * DriveWire subroutine entry table @@ -149,7 +163,8 @@ os9 F$IRQ ;install puls u bcs InitEx ;exit with error - ldd #$0003 ;lets try every 6 ticks (0.1 seconds) -- testing 3, gives better response in interactive things + clra + ldb PollSpd3,pcr ; start at idle ifgt Level-1 ldx D.DWStat + endc + lda DW.VIRQFRQ,x + cmpa PollSpd3,pcr + lbeq IRQExit ;we are already at idle speed + lda DW.VIRQNOP,x + inca + cmpa PollIdle,pcr + beq FRQdown + + sta DW.VIRQNOP,x ;inc NOP count, exit + lbra IRQExit + +FRQdown lda DW.VIRQFRQ,x + cmpa PollSpd1,pcr + beq FRQd1 + lda PollSpd3,pcr +FRQd2 + sta DW.VIRQFRQ,x + clr DW.VIRQNOP,x + lbra IRQExit +FRQd1 lda PollSpd2,pcr + bra FRQd2 ; save back D on stack and build our U - pshs d +IRQGotOp pshs d * mode switch on bits 7+6 of A: 00 = vserial, 01 = system, 10 = wirebug?, 11 = ? anda #$C0 ; mask last 6 bits beq mode00 ; virtual serial mode @@ -342,13 +389,13 @@ * multiread/status flag is in bit 4 of A bita #$10 - beq IRQPutch ; branch if multiread not set + beq IRQPutch ; branch for read1 if multiread not set * all 0s in port means status, anything else is multiread bita #$0F ;mask bit 7-4 beq dostat ;port # all 0, this is a status response - bra IRQMulti ;its not all 0, this is a multiread + lbra IRQMulti ;its not all 0, this is a multiread * in status events, databyte is split, 4bits status, 4bits port # @@ -364,6 +411,21 @@ bne statcont ; if A is 0, then this device is not active, so exit lbra IRQExit +* IRQ set freq routine +* sets freq and clears NOP counter +* a = desired IRQ freq +IRQsetFRQ pshs x ; preserve + ifgt Level-1 + ldx D.DWStat + endc + sta DW.VIRQFRQ,x + clr DW.VIRQNOP,x + puls x + rts + + * This routine roots through process descriptors in a queue and * checks to see if the process has a path that is open to the device * represented by the static storage pointer in U. if so, the S$HUP @@ -418,7 +480,7 @@ beq CkLPRC bsr RootThrough -CkLPRC +CkLPRC lda