Skip to content

Commit 891db47

Browse files
committed
Merge branch 'bugfix/example' into 'master'
example_gpio: Update the IO of the gpio example to work on all ESP devkits See merge request app-frameworks/esp-rainmaker!304
2 parents e02cd57 + 082a916 commit 891db47

File tree

11 files changed

+52
-8
lines changed

11 files changed

+52
-8
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,7 @@ docs/docusaurus/website/node_modules
7979

8080
# cli logs
8181
**/logs
82+
83+
# IDF package manager
84+
**/managed_components/
85+
*.lock

components/esp_rainmaker/src/standard_types/esp_rmaker_standard_params.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ esp_rmaker_param_t *esp_rmaker_temperature_param_create(const char *param_name,
115115
{
116116
esp_rmaker_param_t *param = esp_rmaker_param_create(param_name, ESP_RMAKER_PARAM_TEMPERATURE,
117117
esp_rmaker_float(val), PROP_FLAG_READ);
118+
if (param) {
119+
esp_rmaker_param_add_ui_type(param, ESP_RMAKER_UI_TEXT);
120+
}
118121
return param;
119122
}
120123

examples/fan/main/app_driver.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
/* This is the button that is used for toggling the power */
2222
#define BUTTON_GPIO CONFIG_EXAMPLE_BOARD_BUTTON_GPIO
2323
#define BUTTON_ACTIVE_LEVEL 0
24-
/* This is the GPIO on which the power will be set */
25-
#define OUTPUT_GPIO 19
2624

2725
#define DEFAULT_HUE 180
2826
#define DEFAULT_SATURATION 100

examples/gpio/main/Kconfig.projbuild

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,22 @@ menu "Example Configuration"
88
GPIO number on which the "Boot" button is connected. This is generally used
99
by the application for custom operations like toggling states, resetting to defaults, etc.
1010

11+
config EXAMPLE_OUTPUT_GPIO_RED
12+
int "Red GPIO"
13+
default 2
14+
help
15+
Control digital RGB LEDs. Need to connect this GPIO to the red pin of the LED.
16+
17+
config EXAMPLE_OUTPUT_GPIO_GREEN
18+
int "Green GPIO"
19+
default 4
20+
help
21+
Control digital RGB LEDs. Need to connect this GPIO to the green pin of the LED.
22+
23+
config EXAMPLE_OUTPUT_GPIO_BLUE
24+
int "Blue GPIO"
25+
default 5
26+
help
27+
Control digital RGB LEDs. Need to connect this GPIO to the blue pin of the LED.
28+
1129
endmenu

examples/gpio/main/app_driver.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
#define BUTTON_ACTIVE_LEVEL 0
2121
/* This is the GPIO on which the power will be set */
2222

23-
#define OUTPUT_GPIO_RED 16ULL
24-
#define OUTPUT_GPIO_GREEN 14ULL
25-
#define OUTPUT_GPIO_BLUE 15ULL
23+
#define OUTPUT_GPIO_RED CONFIG_EXAMPLE_OUTPUT_GPIO_RED
24+
#define OUTPUT_GPIO_GREEN CONFIG_EXAMPLE_OUTPUT_GPIO_GREEN
25+
#define OUTPUT_GPIO_BLUE CONFIG_EXAMPLE_OUTPUT_GPIO_BLUE
2626

2727
#define WIFI_RESET_BUTTON_TIMEOUT 3
2828
#define FACTORY_RESET_BUTTON_TIMEOUT 10

examples/homekit_switch/main/Kconfig.projbuild

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,11 @@ menu "Example Configuration"
3232
GPIO number on which the "Boot" button is connected. This is generally used
3333
by the application for custom operations like toggling states, resetting to defaults, etc.
3434

35+
config EXAMPLE_OUTPUT_GPIO
36+
int "Output GPIO"
37+
default 19
38+
help
39+
This is an output GPIO that will be connected to a relay or other driver circuit in most cases.
40+
If the power changes, this GPIO output level will also change.
41+
3542
endmenu

examples/homekit_switch/main/app_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define BUTTON_ACTIVE_LEVEL 0
2323

2424
/* This is the GPIO on which the power will be set */
25-
#define OUTPUT_GPIO 19
25+
#define OUTPUT_GPIO CONFIG_EXAMPLE_OUTPUT_GPIO
2626
static bool g_power_state = DEFAULT_POWER;
2727

2828
/* These values correspoind to H,S,V = 120,100,10 */

examples/multi_device/main/Kconfig.projbuild

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,11 @@ menu "Example Configuration"
88
GPIO number on which the "Boot" button is connected. This is generally used
99
by the application for custom operations like toggling states, resetting to defaults, etc.
1010

11+
config EXAMPLE_OUTPUT_GPIO
12+
int "Output GPIO"
13+
default 19
14+
help
15+
This is an output GPIO that will be connected to a relay or other driver circuit in most cases.
16+
If the power changes, this GPIO output level will also change.
17+
1118
endmenu

examples/multi_device/main/app_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#define BUTTON_GPIO CONFIG_EXAMPLE_BOARD_BUTTON_GPIO
2424
#define BUTTON_ACTIVE_LEVEL 0
2525
/* This is the GPIO on which the power will be set */
26-
#define OUTPUT_GPIO 19
26+
#define OUTPUT_GPIO CONFIG_EXAMPLE_OUTPUT_GPIO
2727

2828
/* These values correspoind to H,S,V = 120,100,10 */
2929
#define DEFAULT_RED 0

examples/switch/main/Kconfig.projbuild

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,12 @@ menu "Example Configuration"
1515
Enable this option to test mobile push notifications. When enabled, turning on the switch using
1616
push button will trigger a parameter notification {"Switch":{"Power":true}} and turning off will
1717
trigger an alert "Switch was turned off".
18+
19+
config EXAMPLE_OUTPUT_GPIO
20+
int "Output GPIO"
21+
default 19
22+
help
23+
This is an output GPIO that will be connected to a relay or other driver circuit in most cases.
24+
If the power changes, this GPIO output level will also change.
1825

1926
endmenu

examples/switch/main/app_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#define BUTTON_ACTIVE_LEVEL 0
2323

2424
/* This is the GPIO on which the power will be set */
25-
#define OUTPUT_GPIO 19
25+
#define OUTPUT_GPIO CONFIG_EXAMPLE_OUTPUT_GPIO
2626
static bool g_power_state = DEFAULT_POWER;
2727

2828
/* These values correspoind to H,S,V = 120,100,10 */

0 commit comments

Comments
 (0)