Browse Source

added define to switch app logic for demo

pull/3/head
Hendrik Schutter 1 year ago
parent
commit
e88b6e2664
  1. 24
      main/Blinky_LED.c
  2. 6
      main/Blinky_LED.h

24
main/Blinky_LED.c

@ -79,8 +79,13 @@ void vGPIOInitialize(void)
gpio_config_t gpioConf;
//LED as Output
gpio_reset_pin(GPIO_LED);
gpio_set_direction(GPIO_LED, GPIO_MODE_OUTPUT);
gpio_reset_pin(GPIO_LED_BLUE);
gpio_set_direction(GPIO_LED_BLUE, GPIO_MODE_OUTPUT);
#ifdef NEW_VERSION
gpio_reset_pin(GPIO_LED_GREEN);
gpio_set_direction(GPIO_LED_GREEN, GPIO_MODE_OUTPUT);
#endif
//BTN as Input
gpioConf.intr_type = GPIO_INTR_DISABLE;
@ -212,19 +217,28 @@ void vTaskReceiveData(void *arg)
{
case LED_ON:
bLEDisOn = true;
gpio_set_level(GPIO_LED, 1); //switch on
gpio_set_level(GPIO_LED_BLUE, 1); //switch on
#ifdef NEW_VERSION
gpio_set_level(GPIO_LED_GREEN, 1); //switch on
#endif
ESP_LOGI(LOG_TAG,"switch LED ON");
break;
case LED_OFF:
bLEDisOn = false;
gpio_set_level(GPIO_LED, 0); //switch off
gpio_set_level(GPIO_LED_BLUE, 0); //switch off
#ifdef NEW_VERSION
gpio_set_level(GPIO_LED_GREEN, 0); //switch off
#endif
ESP_LOGI(LOG_TAG,"switch LED OFF");
break;
default:
bLEDisOn = false;
gpio_set_level(GPIO_LED, 0); //switch off
gpio_set_level(GPIO_LED_BLUE, 0); //switch off
#ifdef NEW_VERSION
gpio_set_level(GPIO_LED_GREEN, 0); //switch off
#endif
ESP_LOGI(LOG_TAG,"switch LED OFF");
break;
}

6
main/Blinky_LED.h

@ -20,9 +20,13 @@
#include "Mesh_OTA.h"
#define NEW_VERSION
#define GPIO_BOOT_BTN 0 //GPIO0 (Boot BTN)
#define GPIO_LED 2 //GPIO2 (internal blue LED in DevKit V1.0)
#define GPIO_LED_BLUE 2 //GPIO2 (internal blue LED in DevKit V1.0)
#ifdef NEW_VERSION
#define GPIO_LED_GREEN 13 //GPIO13
#endif
#define GPIO_INPUT_PIN_SEL (1ULL<<GPIO_BOOT_BTN)

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close