Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"W5300.c, wiz_recv_data function" #126

Open
jewoolee opened this issue Nov 2, 2022 · 0 comments
Open

"W5300.c, wiz_recv_data function" #126

jewoolee opened this issue Nov 2, 2022 · 0 comments

Comments

@jewoolee
Copy link

jewoolee commented Nov 2, 2022

Hi everyone

I think should be change the wiz_recv_data in w5300.c

because, If they use 16 bit process, recv buffer was big problems.

Please look at the bold font.

If "wizdata[i] = (uint8_t)(rd >> 8)" data was 0x0101, when use 16bit process, assign is value 0x0101.
It was very big mistake.

WiznetIOdriver use default 8bit process, i think this change was not problem.

void wiz_recv_data(uint8_t sn, uint8_t *wizdata, uint32_t len)
{
uint16_t rd = 0;
uint32_t i = 0;
if(len == 0) return;
for(i = 0; i < len; i++)
{
if((i & 0x01)==0)
{
rd = getSn_RX_FIFOR(sn);
wizdata[i] = (uint8_t)(rd >> 8);
}
else wizdata[i] = (uint8_t)rd; // For checking the memory access violation
}
sock_remained_byte[sn] = (uint8_t)rd & 0x00FFu; // back up the remaind fifo byte.
// If you use 16 bit process, perhaps, It should be recv buffer error
// I think it should be inclue the mask LSB.

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant