From 30d8e162b39a5fe50745dccb09ea349c956ed3ff Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Tue, 9 Feb 2016 10:58:56 +1100 Subject: [PATCH] blink example: Change default to GPIO2 as this pin has an LED on most boards --- examples/blink/blink.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/blink/blink.c b/examples/blink/blink.c index 92fe700..9d2ae3c 100644 --- a/examples/blink/blink.c +++ b/examples/blink/blink.c @@ -8,7 +8,7 @@ #include "task.h" #include "esp8266.h" -const int gpio = 14; +const int gpio = 2; /* This task uses the high level GPIO API (esp_gpio.h) to blink an LED. * @@ -30,7 +30,7 @@ void blinkenTask(void *pvParameters) The step that sets the iomux register can't be automatically updated from the 'gpio' constant variable, so you need to change - the line that sets IOMUX_GPIO14 if you change 'gpio'. + the line that sets IOMUX_GPIO2 if you change 'gpio'. There is no significant performance benefit to this way over the blinkenTask version, so it's probably better to use the blinkenTask @@ -41,7 +41,7 @@ void blinkenTask(void *pvParameters) void blinkenRegisterTask(void *pvParameters) { GPIO.ENABLE_OUT_SET = BIT(gpio); - IOMUX_GPIO14 = IOMUX_GPIO14_FUNC_GPIO | IOMUX_PIN_OUTPUT_ENABLE; /* change this line if you change 'gpio' */ + IOMUX_GPIO2 = IOMUX_GPIO2_FUNC_GPIO | IOMUX_PIN_OUTPUT_ENABLE; /* change this line if you change 'gpio' */ while(1) { GPIO.OUT_SET = BIT(gpio); vTaskDelay(1000 / portTICK_RATE_MS);