Skip to content

Update Lwip error calls to use new error codes and mbed_error call #7725

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

Merged
merged 1 commit into from
Aug 9, 2018

Conversation

SenRamakri
Copy link
Contributor

Description

This is to update LWIP error() calls to use the new Mbed-OS Error handler methods, this enables use of error codes, produces more informative error report and also enables use of error decoding tools like Mbed-Error microsite - https://armmbed.github.io/mbedos-error/

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Feature
[ ] Breaking change

@SenRamakri SenRamakri requested a review from SeppoTakalo August 7, 2018 22:41
@cmonr cmonr requested a review from kjbracey August 8, 2018 02:57
Copy link
Contributor

@cmonr cmonr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments.

@@ -418,7 +428,7 @@ void sys_init(void) {
lwip_sys_mutex_attr.cb_size = sizeof(lwip_sys_mutex_data);
lwip_sys_mutex = osMutexNew(&lwip_sys_mutex_attr);
if (lwip_sys_mutex == NULL)
error("sys_init error\n");
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_NETWORK_STACK, MBED_ERROR_CODE_INITIALIZATION_FAILED), "sys_init error, mutex initialization failed\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between MBED_ERROR1 and MBED_ERROR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmonr - MBED_ERROR1 takes an additional context specific parameter for the error context where as MBED_ERROR doesn't.

#include "mbed-trace/mbed_trace.h"

void lwip_mbed_tracef_debug(const char *fmt, ...)
{
va_list ap;
#if MBED_CONF_LWIP_USE_MBED_TRACE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making a note here that this'll probably result in a code size increase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't intend to make that change. I'll look into that.

@SenRamakri SenRamakri force-pushed the sen_LwipMbedErrorUpdate branch from b144ded to 01c46f0 Compare August 8, 2018 15:21
@SenRamakri
Copy link
Contributor Author

@cmonr - I have addressed the review comments, please review.

@cmonr
Copy link
Contributor

cmonr commented Aug 8, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Aug 8, 2018

Build : SUCCESS

Build number : 2764
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7725/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Aug 8, 2018

@mbed-ci
Copy link

mbed-ci commented Aug 8, 2018

@cmonr cmonr merged commit 1a5b3e0 into ARMmbed:master Aug 9, 2018
pan- pushed a commit to pan-/mbed that referenced this pull request Aug 22, 2018
Update Lwip error calls to use new error codes and mbed_error call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants