瀏覽代碼

Add AudioNoInterrupts() and AudioInterrupts()

dds
PaulStoffregen 11 年之前
父節點
當前提交
67e7db35a6
共有 1 個文件被更改,包括 15 次插入0 次删除
  1. +15
    -0
      Audio.h

+ 15
- 0
Audio.h 查看文件

@@ -1,5 +1,20 @@
#include "AudioStream.h"


// When changing multiple audio object settings that must update at
// the same time, these functions allow the audio library interrupt
// to be disabled. For example, you may wish to begin playing a note
// in response to reading an analog sensor. If you have "velocity"
// information, you might start the sample playing and also adjust
// the gain of a mixer channel. Use AudioNoInterrupts() first, then
// make both changes to the 2 separate objects. Then allow the audio
// library to update with AudioInterrupts(). Both changes will happen
// at the same time, because AudioNoInterrupts() prevents any updates
// while you make changes.
#define AudioNoInterrupts() (NVIC_DISABLE_IRQ(IRQ_SOFTWARE))
#define AudioInterrupts() (NVIC_ENABLE_IRQ(IRQ_SOFTWARE))


// waveforms.c
extern "C" {
extern const int16_t AudioWaveformSine[257];

Loading…
取消
儲存