src.nth.io/

summaryrefslogtreecommitdiff
path: root/main/src/led.c
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2021-06-02 12:08:39 -0500
committerLuke Hoersten <[email protected]>2021-06-02 12:08:39 -0500
commit4043b33110efcd068078d19d9a37242b00ce9710 (patch)
tree68d3ceb78f3260123c210fc4402d3307795e95c0 /main/src/led.c
parent15de81b31cebee8b6a7cceec383d9c51b6002596 (diff)
Cleaned up variable names.
Diffstat (limited to 'main/src/led.c')
-rw-r--r--main/src/led.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/main/src/led.c b/main/src/led.c
index b000e18..55c6ae4 100644
--- a/main/src/led.c
+++ b/main/src/led.c
@@ -7,31 +7,31 @@
#include <led.h>
#include <intercom.h>
-#define LED_ON 1
#define LED_OFF 0
-#define LED_DELAY 500
+#define LED_ON 1
+#define LED_DELAY_MILLIS 500
#define LED_NUM_BLINK 3
-int intercom_led_identify(hap_acc_t *ha)
+int led_identify(hap_acc_t *ha)
{
ESP_LOGI(TAG, "accessory identified");
for (int i = 0; i < LED_NUM_BLINK; i++)
{
gpio_set_level(GPIO_NUM_13, LED_ON);
- vTaskDelay(pdMS_TO_TICKS(LED_DELAY));
+ vTaskDelay(pdMS_TO_TICKS(LED_DELAY_MILLIS));
gpio_set_level(GPIO_NUM_13, LED_OFF);
- vTaskDelay(pdMS_TO_TICKS(LED_DELAY));
+ vTaskDelay(pdMS_TO_TICKS(LED_DELAY_MILLIS));
}
return HAP_SUCCESS;
}
-void intercom_led_init()
+void led_identify_service_init()
{
gpio_config_t io_conf;
- io_conf.intr_type = GPIO_INTR_DISABLE; /* Interrupt for falling edge */
- io_conf.pin_bit_mask = GPIO_SEL_13; /* Bit mask of the pins */
- io_conf.mode = GPIO_MODE_OUTPUT; /* Set as input mode */
- io_conf.pull_up_en = GPIO_PULLUP_DISABLE; /* Disable internal pull-up */
- io_conf.pull_down_en = GPIO_PULLDOWN_ENABLE; /* Enable internal pull-down */
- gpio_config(&io_conf); /* Set the GPIO configuration */
+ io_conf.intr_type = GPIO_INTR_DISABLE;
+ io_conf.pin_bit_mask = GPIO_SEL_13;
+ io_conf.mode = GPIO_MODE_OUTPUT;
+ io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
+ io_conf.pull_down_en = GPIO_PULLDOWN_ENABLE;
+ gpio_config(&io_conf);
} \ No newline at end of file