-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Update nrf_cloud_rest_device_message sample to use CAF instead of DK library #12026
Merged
rlubos
merged 1 commit into
nrfconnect:main
from
tony-le-24:update-rest-device-message-sample
Aug 24, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
samples/cellular/nrf_cloud_rest_device_message/boards/nrf9160dk_nrf9160_ns.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* Copyright (c) 2023 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/ { | ||
/* Define 4 monochromatic LEDs connected directly | ||
* to the GPIO to be used with CAF LEDs module | ||
*/ | ||
led0 { | ||
compatible = "gpio-leds"; | ||
status = "okay"; | ||
|
||
led0_0: led_0 { | ||
gpios = <&gpio0 2 0>; | ||
}; | ||
}; | ||
|
||
led1 { | ||
compatible = "gpio-leds"; | ||
status = "okay"; | ||
|
||
led1_0: led_0 { | ||
gpios = <&gpio0 3 0>; | ||
}; | ||
}; | ||
|
||
led2 { | ||
compatible = "gpio-leds"; | ||
status = "okay"; | ||
|
||
led2_0: led_0 { | ||
gpios = <&gpio0 4 0>; | ||
}; | ||
}; | ||
|
||
led3 { | ||
compatible = "gpio-leds"; | ||
status = "okay"; | ||
|
||
led3_0: led_0 { | ||
gpios = <&gpio0 5 0>; | ||
}; | ||
}; | ||
|
||
/* Disable the original leds node from device-tree | ||
* since it is incompatible with the CAF LEDs module | ||
*/ | ||
leds { | ||
status = "disabled"; | ||
}; | ||
}; |
25 changes: 25 additions & 0 deletions
25
samples/cellular/nrf_cloud_rest_device_message/include/buttons_def.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright (c) 2023 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
#include <caf/gpio_pins.h> | ||
|
||
/* This file is included by the common application framework (CAF) library */ | ||
|
||
/* This configuration file is included only once from buttons module and holds | ||
* information about pins forming the keyboard matrix. | ||
*/ | ||
|
||
/* This structure enforces the header file to be included only once in the build. | ||
* Violating this requirement triggers a multiple definition error at link time. | ||
*/ | ||
const struct {} buttons_def_include_once; | ||
|
||
static const struct gpio_pin col[] = {}; | ||
|
||
static const struct gpio_pin row[] = { | ||
{ .port = 0, .pin = DT_GPIO_PIN(DT_NODELABEL(button0), gpios) }, | ||
{ .port = 0, .pin = DT_GPIO_PIN(DT_NODELABEL(button1), gpios) }, | ||
}; |
28 changes: 28 additions & 0 deletions
28
samples/cellular/nrf_cloud_rest_device_message/include/leds_def.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright (c) 2023 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
#include <caf/led_effect.h> | ||
|
||
/* This configuration file is included only once from the main module and holds | ||
* information about LED on and off effects. | ||
*/ | ||
|
||
/* This structure enforces the header file to be included only once in the build. | ||
* Violating this requirement triggers a multiple definition error at link time. | ||
*/ | ||
const struct {} leds_def_include_once; | ||
|
||
enum led_id { | ||
LED_ID_0, | ||
LED_ID_1, | ||
LED_ID_2, | ||
LED_ID_3, | ||
|
||
LED_ID_COUNT | ||
}; | ||
|
||
static const struct led_effect led_effect_on = LED_EFFECT_LED_ON(LED_COLOR(255, 255, 255)); | ||
static const struct led_effect led_effect_off = LED_EFFECT_LED_OFF(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We need to add support for the 9161 to all our samples. I've created a ticket for it: https://nordicsemi.atlassian.net/browse/IRIS-6848.
When that happens, there will need to be an overlay for that as well here, I assume.