mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
While the current implementation works for what it is actually used, it is broken when trying to do larger transfers. The length field in the control register has a size of 4 bits. In every transfer, length+1 bytes are read. Thus, each transfer is limited to a maximum of 16 bytes. Add a check for the length, and write the correct value to the register. Also update the loop in "sfp_send_data" to properly increment the output register. Remove the unused special case for a length of 128 bytes.