Skip to content

Commit 1d067f1

Browse files
Merge pull request #447 from Wuerfel21/w21-9pidkwhattocallthis
Add missing wrlong optimization in a 9P-related file
2 parents ada40c8 + 685cda8 commit 1d067f1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/filesys/fs9p/fs9p_vfs.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ static int plain_sendrecv(uint8_t *startbuf, uint8_t *endbuf, int maxlen)
5252

5353
flags = _getrxtxflags();
5454
_setrxtxflags(0); // raw mode
55+
#ifdef __P2__
56+
*(int*)startbuf = len;
57+
#else
5558
startbuf[0] = len & 0xff;
5659
startbuf[1] = (len>>8) & 0xff;
5760
startbuf[2] = (len>>16) & 0xff;
5861
startbuf[3] = (len>>24) & 0xff;
62+
#endif
5963

6064
if (len <= 4) {
6165
return -1; // not a valid message
@@ -68,10 +72,14 @@ static int plain_sendrecv(uint8_t *startbuf, uint8_t *endbuf, int maxlen)
6872
--len;
6973
}
7074
len = zdoGet4();
75+
#ifdef __P2__
76+
*(int*)startbuf = len;
77+
#else
7178
startbuf[0] = len & 0xff;
7279
startbuf[1] = (len>>8) & 0xff;
7380
startbuf[2] = (len>>16) & 0xff;
7481
startbuf[3] = (len>>24) & 0xff;
82+
#endif
7583
buf = startbuf+4;
7684
left = len - 4;
7785
while (left > 0 && i < maxlen) {

0 commit comments

Comments
 (0)