Skip to content

Conversation

@carlescufi
Copy link
Member

Convert the sample to use the new API and its features.

Signed-off-by: Carles Cufi [email protected]

@carlescufi
Copy link
Member Author

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]>
@carlescufi carlescufi changed the title samples: net: lwm2m_client: Convert to new GPIO API [topic-gpio] samples: net: lwm2m_client: Convert to new GPIO API Jan 22, 2020

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);
Copy link
Contributor

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);

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK then.

Copy link
Contributor

@mike-scott mike-scott left a comment

Choose a reason for hiding this comment

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

LGTM

@MaureenHelm MaureenHelm merged commit a7a7c62 into zephyrproject-rtos:topic-gpio Jan 23, 2020
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.

6 participants