mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 05:36:37 +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));
|
memcpy_P(buffer, PSTR("UP"), sizeof(buffer));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// dispatch_button(button->getId(), buffer);
|
dispatch_button(button->getId(), buffer);
|
||||||
mqtt_send_input(button->getId(), buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void buttonSetup(void)
|
void buttonSetup(void)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#define HASP_BUTTON_H
|
#define HASP_BUTTON_H
|
||||||
|
|
||||||
void buttonSetup(void);
|
void buttonSetup(void);
|
||||||
void buttonLoop(void);
|
void IRAM_ATTR buttonLoop(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#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