aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-06-17 19:03:43 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-06-17 19:03:43 +0200
commit9076fd7a7cef6bde83bdf52d41e45a3e0d540a2f (patch)
tree865e3c1d4a8001c149ff1d4f3c091b4fdc976196 /src
parent76f58c6eb4991d3f8c9648d0dc8a57e496f01d5a (diff)
downloadglutte-o-matic-9076fd7a7cef6bde83bdf52d41e45a3e0d540a2f.tar.gz
glutte-o-matic-9076fd7a7cef6bde83bdf52d41e45a3e0d540a2f.tar.bz2
glutte-o-matic-9076fd7a7cef6bde83bdf52d41e45a3e0d540a2f.zip
Fix simulator compilation
Diffstat (limited to 'src')
-rw-r--r--src/common/src/Audio/audio_in.c8
-rw-r--r--src/common/src/Core/main.c3
-rw-r--r--src/simulator/src/Audio/audio_in.c8
3 files changed, 9 insertions, 10 deletions
diff --git a/src/common/src/Audio/audio_in.c b/src/common/src/Audio/audio_in.c
index 01f4794..b046a62 100644
--- a/src/common/src/Audio/audio_in.c
+++ b/src/common/src/Audio/audio_in.c
@@ -22,20 +22,22 @@
* SOFTWARE.
*/
-
+#include "Audio/tone.h"
#include "Audio/audio_in.h"
int16_t audio_in_buffer_0[AUDIO_IN_BUF_LEN];
int16_t audio_in_buffer_1[AUDIO_IN_BUF_LEN];
void audio_in_initialize(int rate) {
- audio_in_buffer = &audio_in_buffer_0;
+ audio_in_buffer = audio_in_buffer_0;
audio_in_initialize_plateform(rate);
}
void audio_in_buffer_ready() {
- detect_tones(audio_in_buffer);
+ for (int i = 0; i < AUDIO_IN_BUF_LEN; i++) {
+ tone_detect_1750(audio_in_buffer[i]);
+ }
if (audio_in_buffer == audio_in_buffer_0) {
audio_in_buffer = audio_in_buffer_1;
diff --git a/src/common/src/Core/main.c b/src/common/src/Core/main.c
index 3a7d186..aaa629b 100644
--- a/src/common/src/Core/main.c
+++ b/src/common/src/Core/main.c
@@ -197,7 +197,8 @@ static void launcher_task(void __attribute__ ((unused))*pvParameters)
}
usart_debug_puts("Tone init\r\n");
- init_tones();
+#warning TODO
+ tone_init(20000);
usart_debug_puts("Audio init\r\n");
audio_initialize(Audio16000HzSettings);
diff --git a/src/simulator/src/Audio/audio_in.c b/src/simulator/src/Audio/audio_in.c
index df3e690..936fe1c 100644
--- a/src/simulator/src/Audio/audio_in.c
+++ b/src/simulator/src/Audio/audio_in.c
@@ -23,6 +23,7 @@
*/
#include <stdio.h>
+#include <assert.h>
#include <pulse/simple.h>
#include "Audio/audio_in.h"
#include "FreeRTOS.h"
@@ -46,10 +47,7 @@ void audio_in_initialize_plateform(int rate) {
s_in = pa_simple_new(NULL, "GlutteR", PA_STREAM_RECORD, NULL, "record", &ss, NULL, NULL, &error);
- if (!s_in) {
- printf("Pulseaudio record init error\n");
- while(1);
- }
+ assert(s_in);
TaskHandle_t task_handle;
xTaskCreate(
@@ -59,13 +57,11 @@ void audio_in_initialize_plateform(int rate) {
(void*) NULL,
tskIDLE_PRIORITY + 2UL,
&task_handle);
-
}
static void audio_buffer_reader(void __attribute__ ((unused)) *args) {
while(1) {
-
pa_simple_read(s_in, audio_in_buffer, AUDIO_IN_BUF_LEN * 2, NULL);
audio_in_buffer_ready();