-
Notifications
You must be signed in to change notification settings - Fork 8.2k
[topic-gpio] samples: net: lwm2m_client: Convert to new GPIO API #22092
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
[topic-gpio] samples: net: lwm2m_client: Convert to new GPIO API #22092
Conversation
|
Tested on nrf52840_pca10056 by inserting a small loop that toggles the pin to avoid having to set up a full LWM2M server. |
Convert the sample to use the new API and its features. Signed-off-by: Carles Cufi <[email protected]>
cf3b665 to
dc87add
Compare
|
|
||
| ret = gpio_pin_write(led_dev, LED_GPIO_PIN, 0); | ||
| ret = gpio_pin_configure(led_dev, LED_GPIO_PIN, LED_GPIO_FLAGS | | ||
| GPIO_OUTPUT_INACTIVE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a style thing (which we do not define) I find it easier to understand when split at the comma rather than within the argument expression:
ret = gpio_pin_configure(led_dev, LED_GPIO_PIN,
LED_GPIO_FLAGS | GPIO_OUTPUT_INACTIVE);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually prefer the style where things are split to max line length and then at the bitwise or logical operator boundary myself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK then.
mike-scott
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Convert the sample to use the new API and its features.
Signed-off-by: Carles Cufi [email protected]