From 537d7e089fbf5c7958d775a6254cdc87d608d4d1 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Tue, 18 Aug 2015 19:56:09 +0200 Subject: [PATCH 1/2] Fixes #2728: edge switch could trigger right after the logicalSwitchesReset() was called --- radio/src/switches.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/radio/src/switches.cpp b/radio/src/switches.cpp index 746e37755..6415699ff 100644 --- a/radio/src/switches.cpp +++ b/radio/src/switches.cpp @@ -835,6 +835,13 @@ void logicalSwitchesTimerTick() #if defined(CPUARM) else if (ls->func == LS_FUNC_EDGE) { ls_stay_struct & lastValue = (ls_stay_struct &)LS_LAST_VALUE(fm, i); + // if this ls was reset by the logicalSwitchesReset() the lastValue will be set to CS_LAST_VALUE_INIT(0x8000) + // when it is unpacked into ls_stay_struct the lastValue.duration will have a value of 0x4000 + // this will produce an instant true for edge logical switch if the second parameter is big enough. + // So we reset it here. + if (LS_LAST_VALUE(fm, i) == CS_LAST_VALUE_INIT) { + lastValue.duration = 0; + } lastValue.state = false; bool state = getSwitch(ls->v1); if (state) { From 4056287d3dc40b3bb31ce8ec9fbd53925a8d9098 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Tue, 18 Aug 2015 20:12:54 +0200 Subject: [PATCH 2/2] Re #2728: Release notes updated --- radio/releasenotes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/radio/releasenotes.txt b/radio/releasenotes.txt index 5e9a31238..260781f32 100644 --- a/radio/releasenotes.txt +++ b/radio/releasenotes.txt @@ -9,6 +9,7 @@
  • Fixed: Playing two background sounds at once causes sound to stop (#2704)
  • Several fixes to the SD card manager menu (#2623)
  • Fixed the difference between top and main LCD TX battery bars on 9Xe (#2671)
  • +
  • Fixed: Edge Logical Switch could trigger right after the model was loaded or the radio turned on (#2728)
  • [Sky9x / 9XR-PRO]