anchor.diff:  
   : ep-in ( ep -- )  \ incoming polls, sent from this device to host
     dup if
  -    0 tx.pend ! usb-fill
  +    0 usb.ticks !  0 tx.pend !  usb-fill
     else
       $41 usb-pma c@ $05 = if $42 usb-pma@ $80 or USB-DADDR h! then
       send-next
  
positive.code: : usb-key? ( -- f )  pause usb-poll usb-in-ring ring# 0<> ;
  : usb-key ( -- c )  begin usb-key? until  usb-in-ring ring> ;
  : usb-emit? ( -- f )  usb-poll usb-out-ring ring? ;
  : usb-emit ( c -- )  begin usb-emit? until  usb-out-ring >ring usb-fill ;
  
  : usb-io ( -- )  \ start up USB and switch console I/O to it
    23 bit RCC-APB1ENR bis!  \ USBEN
  
negative.code:   $41 usb-pma c@ case
      $00 of zero 2 send-data endof
      $06 of send-desc endof
      ( default ) 0 0 send-data
    endcase
    ep-reset-rx# send-next ;
  
  : usb-recv ( c -- ) usb-in-ring dup ring? if >ring else 2drop then ;
  
  0 variable tx.pend
  0 variable usb.ticks
  
  : usb-pma-c! ( b pos -- )  \ careful, can't write high bytes separately
    dup 1 and if
  