Added clang-format (#623)

* added .clang-format
* added names to travis jobs
removed deprecated travis option
* check github action
* added .gitignore
This commit is contained in:
Leon Kiefer authored and GitHub committed 2020-06-09 16:09:23 -05:00
1 parent 661ef9c55e
commit 10a9d00aaf
59 files changed
+2892 -3640

No files matched your search

+10 -18
View File
@@ -30,37 +30,29 @@
#ifdef ZsensorHCSR501
void setupHCSR501()
{
void setupHCSR501() {
Log.notice(F("HCSR501 pin: %d" CR), HCSR501_PIN);
pinMode(HCSR501_PIN, INPUT); // declare HC SR-501 pin as input
}
void MeasureHCSR501()
{
if (millis() > TimeBeforeStartHCSR501)
{ //let time to init the PIR sensor
void MeasureHCSR501() {
if (millis() > TimeBeforeStartHCSR501) { //let time to init the PIR sensor
const int JSON_MSG_CALC_BUFFER = JSON_OBJECT_SIZE(1);
StaticJsonBuffer<JSON_MSG_CALC_BUFFER> jsonBuffer;
JsonObject &HCSR501data = jsonBuffer.createObject();
JsonObject& HCSR501data = jsonBuffer.createObject();
static int pirState = LOW;
int PresenceValue = digitalRead(HCSR501_PIN);
#if defined(ESP8266) || defined(ESP32)
# if defined(ESP8266) || defined(ESP32)
yield();
#endif
if (PresenceValue == HIGH)
{
if (pirState == LOW)
{
# endif
if (PresenceValue == HIGH) {
if (pirState == LOW) {
//turned on
HCSR501data.set("hcsr501", "true");
pirState = HIGH;
}
}
else
{
if (pirState == HIGH)
{
} else {
if (pirState == HIGH) {
// turned off
HCSR501data.set("hcsr501", "false");
pirState = LOW;