We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I found that the queue implementation in [uC-Modbus 2.14.00: OS/None/mb_os.c](https://github.com/weston-embedded/uC-Modbus/blob/develop/OS/None/mb_os.c commit fdd1218) is broken. It will point to the wrong entry in the storage table.
I could fix it within the initialization function MB_OS_Q_Create(...): p_q->OS_Q_LastEntry = max_entries-1; instead of p_q->OS_Q_LastEntry = 0;
p_q->OS_Q_LastEntry = max_entries-1;
p_q->OS_Q_LastEntry = 0;
This is because OS_Q_LastEntry will be incremented (with rollover) in MB_OS_Q_Post(...) before using it as index within the storage table:
OS_Q_LastEntry
//(...) p_q->OS_Q_Entries++; if (p_q->OS_Q_LastEntry == (p_q->OS_Q_MaxEntries - 1)) { p_q->OS_Q_LastEntry = 0; } else { p_q->OS_Q_LastEntry++; } p_sto[p_q->OS_Q_LastEntry] = p_msg; //(...)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I found that the queue implementation in [uC-Modbus 2.14.00: OS/None/mb_os.c](https://github.com/weston-embedded/uC-Modbus/blob/develop/OS/None/mb_os.c commit fdd1218) is broken. It will point to the wrong entry in the storage table.
I could fix it within the initialization function MB_OS_Q_Create(...):
p_q->OS_Q_LastEntry = max_entries-1;
instead of
p_q->OS_Q_LastEntry = 0;
This is because
OS_Q_LastEntry
will be incremented (with rollover) in MB_OS_Q_Post(...) before using it as index within the storage table:The text was updated successfully, but these errors were encountered: