Shop OBEX P1 Docs P2 Docs Learn Events
[but worked around] Not all images on page getting loaded. - Page 2 — Parallax Forums

[but worked around] Not all images on page getting loaded.

2»

Comments

  • kuismakuisma Posts: 134
    edited 2011-03-07 00:07
    kuisma,

    If you don't mind indulging me, please give the site another try. I've made a temporary change to txTCP to test your idea:
          repeat while _size > 0
            'wait for room in the W5100 to send some of the data
            repeat until (freespace.word[0] [color=red]=> 1024[/color])
              readIND((_S0_TX_FSRO + (_socket * $0100)), @temp0, 2)
              freespace.byte[1] := temp0.byte[0]
              freespace.byte[0] := temp0.byte[1]
            chunksize := _size <# freespace.word[0]
    
    Thanks,
    -Phil

    Buffer hysteresis. I like that.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-03-07 00:07
    Much better! (Attached.)
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-03-07 00:08
    kusima wrote:
    Buffer hysteresis. I like that.
    Is it a reasonable thing to leave in the code, do you think?

    -Phil
  • kuismakuisma Posts: 134
    edited 2011-03-07 00:21
    Is it a reasonable thing to leave in the code, do you think?

    Yes. With a static 2k buffer, I think this works very well. Tim seems to implement support for different buffer sizes, and I believe the optimum would be min(mtu,buffersize) instead of static 1024.
  • kuismakuisma Posts: 134
    edited 2011-03-07 00:29
    I'm working on a major rewrite of the driver, but each time I work on it, the rewrite just grows larger. :) I'll try to finish something usable within the week, implementing your buffer hysteresis in it as well.

    I've changed the structure of the code, so the Indirect and SPI driver utilizes the same code base, making future driver development much easier and less error prone.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-03-07 00:33
    How about this:
            repeat until (freespace.word[0] > tx_mask_S[_socket] >> 1)
    
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-03-07 00:37
    I'm working on a major rewrite of the driver
    While you're at it, there are a lot of places that have multiplications by a power of two (i.e. xxx * $800). These would be much more efficiently implemented as shifts.

    -Phil
  • kuismakuisma Posts: 134
    edited 2011-03-07 00:45
    How about this:
            repeat until (freespace.word[0] > tx_mask_S[_socket] >> 1)
    

    It is not the buffer size that is the primary concern, but maximum tcp segment size, as long as it does not exceed the buffer size. With the code above, the W5100 may start sending strange packet sizes, e.g. buffer size of 4096, and the W5100 sends 1500 + 548, 1500 + 548 ... I would prefer to fill one segment and then transmit, there is no idea to demand a larger amount of data than that.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-03-07 00:50
    'Sounds good to me. BTW, thanks much for all your help!!

    -Phil
Sign In or Register to comment.