aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilien Cuony <maximilien@theglu.org>2016-09-15 19:47:27 +0200
committerMaximilien Cuony <maximilien@theglu.org>2016-09-15 19:47:27 +0200
commit2f294aafe21a415f8d57d4827b740ef02c37dd23 (patch)
treea9ace29e1f40780dd668a6bc4721c17960ad65f5
parentc3c8bff0171104769f6af1d5b090c61c328aafdb (diff)
downloadglutte-o-matic-2f294aafe21a415f8d57d4827b740ef02c37dd23.tar.gz
glutte-o-matic-2f294aafe21a415f8d57d4827b740ef02c37dd23.tar.bz2
glutte-o-matic-2f294aafe21a415f8d57d4827b740ef02c37dd23.zip
Add debug for audio. Fix green blinking led
-rw-r--r--src/common/src/Core/main.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/common/src/Core/main.c b/src/common/src/Core/main.c
index 17576cc..99be527 100644
--- a/src/common/src/Core/main.c
+++ b/src/common/src/Core/main.c
@@ -80,6 +80,8 @@ static void launcher_task(void *pvParameters);
// Audio callback function
static void audio_callback(void* context, int select_buffer);
+// Debugging
+static uint64_t timestamp_last_audio_callback = 0;
void vApplicationStackOverflowHook(TaskHandle_t, signed char *);
@@ -205,8 +207,11 @@ static void launcher_task(void __attribute__ ((unused))*pvParameters)
usart_debug_puts("Init done.\r\n");
int last_qrp_from_supply = 0;
+ int send_audio_callback_warning = 0;
+
+ int i = 0;
+
while(1) {
- int i = 0;
vTaskDelay(pdMS_TO_TICKS(1000));
if (i == 0) {
@@ -254,6 +259,18 @@ static void launcher_task(void __attribute__ ((unused))*pvParameters)
}
}
+
+ if (timestamp_now() - timestamp_last_audio_callback > 1000) {
+ if (send_audio_callback_warning == 0) {
+ send_audio_callback_warning = 1;
+ usart_debug("[HOHO] timestamp_last_audio_callback > 1000\r\n");
+ }
+ } else {
+ if (send_audio_callback_warning == 1) {
+ send_audio_callback_warning = 0;
+ usart_debug("[HOHO] Fix ? Now timestamp_last_audio_callback < 1000\r\n");
+ }
+ }
}
}
@@ -328,7 +345,11 @@ static void audio_callback(void __attribute__ ((unused))*context, int select_buf
count_zero_audio_buffer = 0;
}
- audio_provide_buffer_without_blocking(samples, samples_len);
+ if (!audio_provide_buffer_without_blocking(samples, samples_len)) {
+ usart_debug("[HOHO] audio_provide_buffer_without_blocking returned False.\r\n");
+ }
+
+ timestamp_last_audio_callback = timestamp_now();
}