This PR provides a fix for the bugs that appeared at the end of a multi-sector write operation. According to some specifications I consulted, the STOP_TRANS token $FD should not be sent at the beginning of the last sector block, but instead at the end of the whole transmission (without any data following). The problem was that we sent the sector data of the last sector after that token. These bytes were not written anymore, and instead could be interpreted as further SD card command tokens, which depending on the sector data bytes could lead to random behaviour (usually the SD card controller just gets stuck in busy state).
This PR provides a fix for the bugs that appeared at the end of a multi-sector write operation. According to some specifications I consulted, the STOP_TRANS token $FD should not be sent at the beginning of the last sector block, but instead at the end of the whole transmission (without any data following). The problem was that we sent the sector data of the last sector after that token. These bytes were not written anymore, and instead could be interpreted as further SD card command tokens, which depending on the sector data bytes could lead to random behaviour (usually the SD card controller just gets stuck in busy state).