Browse Source

完善按钮问题,发现还没有完美的解决

corvin 5 years ago
parent
commit
a895254f9a
1 changed files with 8 additions and 10 deletions
  1. 8 10
      src/button.c

+ 8 - 10
src/button.c

@@ -24,7 +24,7 @@ static pthread_t s_button_threadID;
 
  void  isr_function(void)
  {
-    DUER_LOGI("isr_function %d\n",digitalRead(BUTTON_GPIO));
+    DUER_LOGI("isr_function %d\n", digitalRead(BUTTON_GPIO));
     return ;
 }
 
@@ -32,20 +32,18 @@ extern int  duer_recorder_test_start(int channel);
 
 static void button_polling_thread()
 {
-	uint32_t  btn_press_time = duer_timestamp();
-	uint32_t  btn_release_time = duer_timestamp();
-	int  channel_id=1;
-
 	 while(1)
 	 {
+            DUER_LOGI("aaaa button_polling_thread %d\n", digitalRead(BUTTON_GPIO));
 			 waitForInterrupt(BUTTON_GPIO, -1);
-                         DUER_LOGI("button_polling_thread %d\n", digitalRead(BUTTON_GPIO));
 			 delay(100);
 			 if(digitalRead(BUTTON_GPIO)==0)
-			 {												duer_dcs_dialog_cancel();									duer_media_tone_play("./resources/16.wav");
-												event_record_start();
-
-			}
+			 {
+                 duer_dcs_dialog_cancel();
+                 duer_media_tone_play("./resources/16.wav");
+                 event_record_start();
+                 DUER_LOGI("button_polling_thread %d\n", digitalRead(BUTTON_GPIO));
+			 }
 	 }
 }