mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-27 21:26:43 +00:00
Add gpio module
This commit is contained in:
parent
181e0c7b88
commit
03fa93b6a0
@ -36,8 +36,7 @@ static void IRAM_ATTR button_event_cb(AceButton * button, uint8_t eventType, uin
|
||||
memcpy_P(buffer, PSTR("UP"), sizeof(buffer));
|
||||
break;
|
||||
}
|
||||
// dispatch_button(button->getId(), buffer);
|
||||
mqtt_send_input(button->getId(), buffer);
|
||||
dispatch_button(button->getId(), buffer);
|
||||
}
|
||||
|
||||
void buttonSetup(void)
|
||||
|
@ -4,7 +4,7 @@
|
||||
#define HASP_BUTTON_H
|
||||
|
||||
void buttonSetup(void);
|
||||
void buttonLoop(void);
|
||||
void IRAM_ATTR buttonLoop(void);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
10
src/hasp_gpio.cpp
Normal file
10
src/hasp_gpio.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include <Arduino.h>
|
||||
#include "ArduinoJson.h"
|
||||
|
||||
void gpioSetup(JsonObject settings)
|
||||
{
|
||||
#if defined(ARDUINO_ARCH_ESP8266)
|
||||
pinMode(D1, OUTPUT);
|
||||
pinMode(D2, INPUT_PULLUP);
|
||||
#endif
|
||||
}
|
3
src/hasp_gpio.h
Normal file
3
src/hasp_gpio.h
Normal file
@ -0,0 +1,3 @@
|
||||
#include "ArduinoJson.h"
|
||||
|
||||
void gpioSetup(JsonObject settings);
|
Loading…
x
Reference in New Issue
Block a user