From 2eadacbf29edba9208ae7acd6c57b311c8e90f70 Mon Sep 17 00:00:00 2001 From: lly Date: Wed, 13 May 2020 15:02:24 +0800 Subject: [PATCH] ble_mesh: Move the button component to common_components --- .../ble_mesh_node/onoff_client/CMakeLists.txt | 2 + .../ble_mesh_node/onoff_client/Makefile | 2 + .../components/button/include/iot_button.h | 230 ---------- .../sensor_client/CMakeLists.txt | 2 + .../sensor_client/Makefile | 2 + .../components/button/CMakeLists.txt | 3 - .../sensor_client/components/button/Kconfig | 21 - .../sensor_client/components/button/README.md | 46 -- .../sensor_client/components/button/button.c | 434 ------------------ .../components/button/button_obj.cpp | 48 -- .../components/button/component.mk | 4 - .../vendor_client/CMakeLists.txt | 2 + .../vendor_client/Makefile | 2 + .../components/button/CMakeLists.txt | 7 - .../vendor_client/components/button/Kconfig | 21 - .../vendor_client/components/button/README.md | 46 -- .../vendor_client/components/button/button.c | 434 ------------------ .../components/button/button_obj.cpp | 48 -- .../components/button/component.mk | 4 - .../components/button/include/iot_button.h | 231 ---------- .../button/CMakeLists.txt | 0 .../button/Kconfig | 0 .../button/README.md | 0 .../button/button.c | 0 .../button/button_obj.cpp | 0 .../button/component.mk | 0 .../button/include/iot_button.h | 0 27 files changed, 12 insertions(+), 1577 deletions(-) delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/components/button/include/iot_button.h delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_client/components/button/CMakeLists.txt delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_client/components/button/Kconfig delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_client/components/button/README.md delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_client/components/button/button.c delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_client/components/button/button_obj.cpp delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_sensor_model/sensor_client/components/button/component.mk delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_client/components/button/CMakeLists.txt delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_client/components/button/Kconfig delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_client/components/button/README.md delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_client/components/button/button.c delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_client/components/button/button_obj.cpp delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_client/components/button/component.mk delete mode 100644 examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_model/vendor_client/components/button/include/iot_button.h rename examples/bluetooth/esp_ble_mesh/{ble_mesh_node/onoff_client/components => common_components}/button/CMakeLists.txt (100%) rename examples/bluetooth/esp_ble_mesh/{ble_mesh_node/onoff_client/components => common_components}/button/Kconfig (100%) rename examples/bluetooth/esp_ble_mesh/{ble_mesh_node/onoff_client/components => common_components}/button/README.md (100%) rename examples/bluetooth/esp_ble_mesh/{ble_mesh_node/onoff_client/components => common_components}/button/button.c (100%) rename examples/bluetooth/esp_ble_mesh/{ble_mesh_node/onoff_client/components => common_components}/button/button_obj.cpp (100%) rename examples/bluetooth/esp_ble_mesh/{ble_mesh_node/onoff_client/components => common_components}/button/component.mk (100%) rename examples/bluetooth/esp_ble_mesh/{ble_mesh_sensor_model/sensor_client/components => common_components}/button/include/iot_button.h (100%) diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/CMakeLists.txt b/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/CMakeLists.txt index d42dfe18f..a08258766 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/CMakeLists.txt +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/CMakeLists.txt @@ -2,6 +2,8 @@ # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) +set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/bluetooth/esp_ble_mesh/common_components/button) + include($ENV{IDF_PATH}/tools/cmake/project.cmake) set(SUPPORTED_TARGETS esp32) project(onoff_client) diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/Makefile b/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/Makefile index a47e6fd08..3c768093b 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/Makefile +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/Makefile @@ -7,4 +7,6 @@ PROJECT_NAME := onoff_client COMPONENT_ADD_INCLUDEDIRS := components/include +EXTRA_COMPONENT_DIRS := $(IDF_PATH)/examples/bluetooth/esp_ble_mesh/common_components/button + include $(IDF_PATH)/make/project.mk diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/components/button/include/iot_button.h b/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/components/button/include/iot_button.h deleted file mode 100644 index 6a2fa23c0..000000000 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_node/onoff_client/components/button/include/iot_button.h +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#ifndef _IOT_BUTTON_H_ -#define _IOT_BUTTON_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "driver/gpio.h" -#include "freertos/portmacro.h" -typedef void (* button_cb)(void*); -typedef void* button_handle_t; - -typedef enum { - BUTTON_ACTIVE_HIGH = 1, /*!