fix: relay buttons always enabled, touch sensor inversion, version bump
- MainActivity: remove isServer check — relay buttons always enabled when connected, regardless of device mode (fixes silently broken buttons when device mode accidentally set to 'client') - client.cpp: invert HS-S43A touch sensor readings (!tActive) — sensors are active LOW - build.gradle: bump versionCode 2, versionName 1.1 - platformio.ini: use stable by-id port for server ESP32 - firmware/*.bin: rebuilt with LED signaling and touch fixes
This commit is contained in:
parent
84e6ca8100
commit
95f440eec8
6 changed files with 11 additions and 13 deletions
|
|
@ -28,8 +28,8 @@ android {
|
||||||
applicationId "nl.eddydevink.sylda"
|
applicationId "nl.eddydevink.sylda"
|
||||||
minSdk 26
|
minSdk 26
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 1
|
versionCode 2
|
||||||
versionName "1.0"
|
versionName "1.1"
|
||||||
buildConfigField "String", "BUILD_NUMBER", "\"${new java.text.SimpleDateFormat("yyyyMMddHHmmss").format(new Date())}\""
|
buildConfigField "String", "BUILD_NUMBER", "\"${new java.text.SimpleDateFormat("yyyyMMddHHmmss").format(new Date())}\""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -40,9 +40,8 @@ class MainActivity : AppCompatActivity(), BleCallbacks {
|
||||||
statusText.text = getString(R.string.status_connected)
|
statusText.text = getString(R.string.status_connected)
|
||||||
setupRelayButton()
|
setupRelayButton()
|
||||||
setupRelay2Button()
|
setupRelay2Button()
|
||||||
val isServer = PrefsHelper.getDeviceMode(this@MainActivity) == "server"
|
relay1Button.isEnabled = true
|
||||||
relay1Button.isEnabled = isServer
|
relay2Button.isEnabled = true
|
||||||
relay2Button.isEnabled = isServer
|
|
||||||
}
|
}
|
||||||
BleStatus.Disconnected -> {
|
BleStatus.Disconnected -> {
|
||||||
statusText.text = getString(R.string.status_connecting)
|
statusText.text = getString(R.string.status_connecting)
|
||||||
|
|
@ -107,9 +106,8 @@ class MainActivity : AppCompatActivity(), BleCallbacks {
|
||||||
}
|
}
|
||||||
setupRelayButton()
|
setupRelayButton()
|
||||||
setupRelay2Button()
|
setupRelay2Button()
|
||||||
val isServer = PrefsHelper.getDeviceMode(this) == "server"
|
relay1Button.isEnabled = true
|
||||||
relay1Button.isEnabled = isServer
|
relay2Button.isEnabled = true
|
||||||
relay2Button.isEnabled = isServer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated("Deprecated in Java")
|
@Deprecated("Deprecated in Java")
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ build_flags =
|
||||||
lib_deps =
|
lib_deps =
|
||||||
fastled/FastLED@^3
|
fastled/FastLED@^3
|
||||||
h2zero/NimBLE-Arduino@^2
|
h2zero/NimBLE-Arduino@^2
|
||||||
upload_port = /dev/ttyACM1
|
upload_port = /dev/serial/by-id/usb-Espressif_USB_JTAG_serial_debug_unit_44:1B:F6:F4:CF:14-if00
|
||||||
upload_speed = 115200
|
upload_speed = 115200
|
||||||
upload_flags = --no-stub
|
upload_flags = --no-stub
|
||||||
build_src_filter = +<main.cpp> -<client.cpp>
|
build_src_filter = +<main.cpp> -<client.cpp>
|
||||||
|
|
|
||||||
|
|
@ -368,8 +368,8 @@ void loop() {
|
||||||
}
|
}
|
||||||
prevBtnActive = btnActive;
|
prevBtnActive = btnActive;
|
||||||
|
|
||||||
bool relay1State = t1Active || btnActive;
|
bool relay1State = !t1Active || btnActive;
|
||||||
bool relay2State = t2Active;
|
bool relay2State = !t2Active;
|
||||||
|
|
||||||
CRGB ledColor;
|
CRGB ledColor;
|
||||||
|
|
||||||
|
|
@ -459,8 +459,8 @@ void loop() {
|
||||||
static uint32_t heartbeat = 0;
|
static uint32_t heartbeat = 0;
|
||||||
if (millis() - heartbeat > 60000) {
|
if (millis() - heartbeat > 60000) {
|
||||||
Serial.printf("[heartbeat] t1=%s t2=%s btn=%s r1=%s r2=%s connected=%s\n",
|
Serial.printf("[heartbeat] t1=%s t2=%s btn=%s r1=%s r2=%s connected=%s\n",
|
||||||
t1Active ? "YES" : "no",
|
!t1Active ? "YES" : "no",
|
||||||
t2Active ? "YES" : "no",
|
!t2Active ? "YES" : "no",
|
||||||
btnActive ? "YES" : "no",
|
btnActive ? "YES" : "no",
|
||||||
relay1State ? "ON" : "OFF",
|
relay1State ? "ON" : "OFF",
|
||||||
relay2State ? "ON" : "OFF",
|
relay2State ? "ON" : "OFF",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue