Final version.
Fork of F746_SAI_IO by
Diff: SAI_InOut.cpp
- Revision:
- 10:eb439bbba0f2
- Parent:
- 9:25a9655d6a0e
- Child:
- 12:4ceb45cb8161
--- a/SAI_InOut.cpp Mon Jan 23 13:35:07 2017 +0000 +++ b/SAI_InOut.cpp Thu Mar 16 08:25:34 2017 +0000 @@ -1,6 +1,6 @@ //----------------------------------------------------------- // SaiIO class -// 2017/01/23, Copyright (c) 2017 MIKAMI, Naoki +// 2017/03/16, Copyright (c) 2017 MIKAMI, Naoki //----------------------------------------------------------- #include "SAI_InOut.hpp" @@ -35,8 +35,7 @@ // Input start void SaiIO::RecordIn() { - if (BSP_AUDIO_IN_Record((uint16_t *)((int16_t *)inBuffer_), - bufferSize_) == AUDIO_ERROR) + if (BSP_AUDIO_IN_Record(inBuffer_, bufferSize_) == AUDIO_ERROR) ErrorTrap(); } @@ -66,8 +65,8 @@ { ClearBuffer(); BSP_AUDIO_OUT_SetAudioFrameSlot(CODEC_AUDIOFRAME_SLOT_02); - if (BSP_AUDIO_OUT_Play((uint16_t *)((int16_t *)outBuffer_), - bufferSize_*AUDIODATA_SIZE) == AUDIO_ERROR) + if (BSP_AUDIO_OUT_Play(outBuffer_, bufferSize_*AUDIODATA_SIZE) + == AUDIO_ERROR) ErrorTrap(); } @@ -185,7 +184,7 @@ __IO bool SaiIO::captured_; __IO int32_t SaiIO::inOffset_; - Array<int16_t> SaiIO::outBuffer_; - Array<int16_t> SaiIO::tmp_; + Array<uint16_t> SaiIO::outBuffer_; + Array<uint16_t> SaiIO::tmp_; __IO bool SaiIO::xferred_; }