From 8618657695b2530f463d1e7e0fca11304d2b897e Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sun, 5 Jun 2016 21:08:03 +0200 Subject: Make object for common/Audio --- src/glutt-o-logique/audio.c | 11 ++++++----- src/glutt-o-logique/cw.c | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/glutt-o-logique') diff --git a/src/glutt-o-logique/audio.c b/src/glutt-o-logique/audio.c index 87bd896..bf41169 100644 --- a/src/glutt-o-logique/audio.c +++ b/src/glutt-o-logique/audio.c @@ -23,10 +23,11 @@ */ #include "GPIO/i2c.h" +#include "Audio/audio.h" #include "stm32f4xx_conf.h" #include "stm32f4xx.h" -#include "../common/src/Audio/audio.c" +static void audio_write_register(uint8_t address, uint8_t value); void audio_initialize_platform(int plln, int pllr, int i2sdiv, int i2sodd, int rate) { @@ -164,7 +165,7 @@ void audio_stop() { audio_stop_dma(); SPI3 ->CR2 &= ~SPI_CR2_TXDMAEN; // Disable I2S TX DMA request. NVIC_DisableIRQ(DMA1_Stream7_IRQn); - callback_function = NULL; + callback_function = (AudioCallbackFunction*)0; } void audio_provide_buffer(void *samples, int numsamples) { @@ -189,7 +190,7 @@ bool audio_provide_buffer_without_blocking(void *samples, int numsamples) { return true; } -static void audio_start_dma_and_request_buffers() { +void audio_start_dma_and_request_buffers() { // Configure DMA stream. DMA1_Stream7 ->CR = (0 * DMA_SxCR_CHSEL_0 ) | // Channel 0 (1 * DMA_SxCR_PL_0 ) | // Priority 1 @@ -205,7 +206,7 @@ static void audio_start_dma_and_request_buffers() { DMA1_Stream7 ->CR |= DMA_SxCR_EN; // Update state. - next_buffer_samples = NULL; + next_buffer_samples = (void*)0; buffer_number ^= 1; dma_running = true; @@ -214,7 +215,7 @@ static void audio_start_dma_and_request_buffers() { callback_function(callback_context, buffer_number); } -static void audio_stop_dma() { +void audio_stop_dma() { DMA1_Stream7 ->CR &= ~DMA_SxCR_EN; // Disable DMA stream. while (DMA1_Stream7 ->CR & DMA_SxCR_EN ) ; // Wait for DMA stream to stop. diff --git a/src/glutt-o-logique/cw.c b/src/glutt-o-logique/cw.c index a54ca83..c362f6a 100644 --- a/src/glutt-o-logique/cw.c +++ b/src/glutt-o-logique/cw.c @@ -22,7 +22,6 @@ * SOFTWARE. */ -#include "../common/src/Audio/cw.c" #include "GPIO/usart.h" // Function to display message in GUI, unused on STM32 firmware -- cgit v1.2.3