sm1000_main: Use !pressed rather than released.
authorsjlongland <sjlongland@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 24 Oct 2015 23:13:18 +0000 (23:13 +0000)
committersjlongland <sjlongland@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 24 Oct 2015 23:13:18 +0000 (23:13 +0000)
We could miss a release event as it is one-shot, whereas !pressed is
constant.

git-svn-id: https://svn.code.sf.net/p/freetel/code@2474 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/stm32/src/sm1000_main.c

index b7dff1d87d0e508413bb391fdb1d1364e49a38e2..39e4372033aaa5521f6601731e9109d61191f3cd 100644 (file)
@@ -426,7 +426,7 @@ int main(void) {
                 break;
             case STATE_TX:
                 {
-                    if (switch_released(&sw_ptt)) {
+                    if (!switch_pressed(&sw_ptt)) {
                         /* PTT released, leave transmit mode */
                         tot_reset(&tot);
                         core_state = STATE_RX;