Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatRed authored Sep 22, 2024
1 parent e717b0e commit bdda8e5
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,13 @@ namespace espConfig
bool gpioActionEnable = GPIO_ACTION_ENABLE;
uint8_t gpioActionPin = GPIO_ACTION_PIN;
uint8_t gpioInputPin = GPIO_INPUT_PIN;
<<<<<<< Updated upstream
=======
uint8_t gpioBuzzerPin = GPIO_BUZZER_PIN;
>>>>>>> Stashed changes
bool gpioActionLockState = GPIO_ACTION_LOCK_STATE;
bool gpioActionUnlockState = GPIO_ACTION_UNLOCK_STATE;
} miscConfig;
}
JSONCONS_ALL_MEMBER_TRAITS(espConfig::mqttConfig_t, mqttBroker, mqttPort, mqttUsername, mqttPassword, mqttClientId, hkTopic, lockStateTopic, lockStateCmd, lockCStateCmd, lockTStateCmd, inputTopic, lockCustomStateTopic, lockCustomStateCmd, lockEnableCustomState, hassMqttDiscoveryEnabled, customLockStates, customLockActions)
<<<<<<< Updated upstream
JSONCONS_ALL_MEMBER_TRAITS(espConfig::misc_config_t, deviceName, hk_key_color, lockAlwaysUnlock, lockAlwaysLock, controlPin, hsStatusPin, nfcSuccessPin, nfcNeopixelPin, nfcSuccessHL, nfcFailPin, nfcFailHL, gpioActionEnable, gpioActionPin, gpioActionLockState, gpioActionUnlockState, gpioInputPin, otaPasswd, setupCode)
=======
JSONCONS_ALL_MEMBER_TRAITS(espConfig::misc_config_t, deviceName, hk_key_color, lockAlwaysUnlock, lockAlwaysLock, controlPin, hsStatusPin, nfcSuccessPin, nfcNeopixelPin, nfcSuccessHL, nfcFailPin, nfcFailHL, gpioActionEnable, gpioActionPin, gpioActionLockState, gpioActionUnlockState, gpioInputPin, gpioBuzzerPin, otaPasswd, setupCode)
>>>>>>> Stashed changes

KeyFlow hkFlow = KeyFlow::kFlowFAST;
SpanCharacteristic* lockCurrentState;
Expand Down Expand Up @@ -685,12 +678,9 @@ String miscHtmlProcess(const String& var) {
else if (var == "GPIOINPIN") {
return String(espConfig::miscConfig.gpioInputPin);
}
<<<<<<< Updated upstream
=======
else if (var == "GPIOBUZPIN") {
return String(espConfig::miscConfig.gpioBuzzerPin);
}
>>>>>>> Stashed changes
else if (var == "HWFINISH") {
return String(espConfig::miscConfig.hk_key_color);
}
Expand Down Expand Up @@ -979,12 +969,9 @@ void setupWeb() {
else if (!strcmp(p->name().c_str(), "gpio-in-pin")) {
espConfig::miscConfig.gpioInputPin = p->value().toInt();
}
<<<<<<< Updated upstream
=======
else if (!strcmp(p->name().c_str(), "gpio-buz-pin")) {
espConfig::miscConfig.gpioBuzzerPin = p->value().toInt();
}
>>>>>>> Stashed changes
else if (!strcmp(p->name().c_str(), "hk-hwfinish")) {
espConfig::miscConfig.hk_key_color = p->value().toInt();
}
Expand Down Expand Up @@ -1183,17 +1170,6 @@ void nfc_thread_entry(void* arg) {
}

void success_tone() {
<<<<<<< Updated upstream
tone(26, 600, 250);
tone(26, 600, 100);
tone(26, 800, 250);
}

void fail_tone() {
tone(26, 600, 250);
tone(26, 600, 100);
tone(26, 400, 250);
=======
tone(espConfig::miscConfig.gpioBuzzerPin, 600, 250);
tone(espConfig::miscConfig.gpioBuzzerPin, 600, 100);
tone(espConfig::miscConfig.gpioBuzzerPin, 800, 250);
Expand All @@ -1203,7 +1179,6 @@ void fail_tone() {
tone(espConfig::miscConfig.gpioBuzzerPin, 600, 250);
tone(espConfig::miscConfig.gpioBuzzerPin, 600, 100);
tone(espConfig::miscConfig.gpioBuzzerPin, 400, 250);
>>>>>>> Stashed changes
}

void gpio_task(void* arg) {
Expand All @@ -1215,7 +1190,6 @@ void gpio_task(void* arg) {
xQueueReceive(gpio_led_handle, &status, 0);
if (status) {
if (espConfig::miscConfig.nfcSuccessPin && espConfig::miscConfig.nfcSuccessPin != 255) {
success_tone();
digitalWrite(espConfig::miscConfig.nfcSuccessPin, espConfig::miscConfig.nfcSuccessHL);
delay(espConfig::miscConfig.nfcSuccessTime);
digitalWrite(espConfig::miscConfig.nfcSuccessPin, !espConfig::miscConfig.nfcSuccessHL);
Expand All @@ -1232,7 +1206,6 @@ void gpio_task(void* arg) {
}
} else {
if (espConfig::miscConfig.nfcFailPin && espConfig::miscConfig.nfcFailPin != 255) {
fail_tone();
digitalWrite(espConfig::miscConfig.nfcFailPin, espConfig::miscConfig.nfcFailHL);
delay(espConfig::miscConfig.nfcFailTime);
digitalWrite(espConfig::miscConfig.nfcFailPin, !espConfig::miscConfig.nfcFailHL);
Expand Down Expand Up @@ -1333,12 +1306,9 @@ void setup() {
if (espConfig::miscConfig.gpioInputPin && espConfig::miscConfig.gpioInputPin != 255) {
pinMode(espConfig::miscConfig.gpioInputPin, INPUT_PULLUP);
}
<<<<<<< Updated upstream
=======
if (espConfig::miscConfig.gpioBuzzerPin && espConfig::miscConfig.gpioBuzzerPin != 255) {
pinMode(espConfig::miscConfig.gpioBuzzerPin, OUTPUT);
}
>>>>>>> Stashed changes
if (!LittleFS.begin(true)) {
Serial.println("An Error has occurred while mounting LITTLEFS");
return;
Expand Down

0 comments on commit bdda8e5

Please sign in to comment.