Compilation error fixed

This commit is contained in:
bsongis
2014-03-05 15:42:51 +01:00
parent 197708c967
commit 5e6cd0ee76
4 changed files with 22 additions and 17 deletions
@@ -111,6 +111,20 @@ bool dacQueue(AudioBuffer *buffer)
}
}
void dacStart()
{
DMA1->HIFCR = DMA_HIFCR_CTCIF5 | DMA_HIFCR_CHTIF5 | DMA_HIFCR_CTEIF5 | DMA_HIFCR_CDMEIF5 | DMA_HIFCR_CFEIF5 ; // Write ones to clear bits
DMA1_Stream5->CR |= DMA_SxCR_CIRC | DMA_SxCR_EN ; // Enable DMA channel
DAC->SR = DAC_SR_DMAUDR1 ; // Write 1 to clear flag
DAC->CR |= DAC_CR_EN1 | DAC_CR_DMAEN1 ; // Enable DAC
}
void dacStop()
{
DMA1_Stream5->CR &= ~DMA_SxCR_CIRC ;
}
// Sound routines
void audioInit()
{
+4 -15
View File
@@ -37,26 +37,15 @@
#ifndef audio_driver_h
#define audio_driver_h
extern void audioInit( void ) ;
extern void audioEnd( void ) ;
void audioInit( void ) ;
void audioEnd( void ) ;
void dacStart();
void dacStop();
extern void setSampleRate(uint32_t frequency);
extern int dacIdle;
inline void dacStart()
{
DMA1->HIFCR = DMA_HIFCR_CTCIF5 | DMA_HIFCR_CHTIF5 | DMA_HIFCR_CTEIF5 | DMA_HIFCR_CDMEIF5 | DMA_HIFCR_CFEIF5 ; // Write ones to clear bits
DMA1_Stream5->CR |= DMA_SxCR_CIRC | DMA_SxCR_EN ; // Enable DMA channel
DAC->SR = DAC_SR_DMAUDR1 ; // Write 1 to clear flag
DAC->CR |= DAC_CR_EN1 | DAC_CR_DMAEN1 ; // Enable DAC
}
inline void dacStop()
{
DMA1_Stream5->CR &= ~DMA_SxCR_CIRC ;
}
#define VOLUME_LEVEL_MAX 23
#define VOLUME_LEVEL_DEF 12
static const int8_t volumeScale[VOLUME_LEVEL_MAX+1] =
+2
View File
@@ -35,6 +35,8 @@
*/
#include "board_taranis.h"
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_dcd_int.h"
#include "STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_bsp.h"
int usbPlugged(void)
{