main/task_sound.c

branch
novnc
changeset 43
2079940c3989
parent 42
c6a1a6ca5437
child 54
7b134c27fadb
--- a/main/task_sound.c	Tue May 07 22:03:38 2019 +0200
+++ b/main/task_sound.c	Wed May 08 13:27:25 2019 +0200
@@ -46,23 +46,17 @@
     char	msg[16];
 
     for (int i = 1; i <= sound[0]; i += 2) {
-	gpio_set_level(PIEZO_BUZZER, 1);
 	if (sound != _sound_Startup) {
 	    snprintf(msg, 15, "{\"beep\":\"1\"}");
     	    ws_server_send_text_clients("/ws", msg, strlen(msg));
 	}
+	gpio_set_level(PIEZO_BUZZER, 1);
 	vTaskDelay(sound[i] / portTICK_PERIOD_MS);
 	gpio_set_level(PIEZO_BUZZER, 0);
-//	if (sound != _sound_Startup) {
-  //          snprintf(msg, 15, "{\"beep\":\"0\"}");
-  //          ws_server_send_text_clients("/ws", msg, strlen(msg));
-//        }
 	vTaskDelay(sound[i+1] / portTICK_PERIOD_MS);
     }
 
     gpio_set_level(PIEZO_BUZZER, 0);	// Just make sure the sound is off.
-//    snprintf(msg, 15, "{\"beep\":\"0\"}");
-//    ws_server_send_text_clients("/ws", msg, strlen(msg));
 }
 
 

mercurial