Kaynağa Gözat

Add AudioNoInterrupts() and AudioInterrupts()

dds
PaulStoffregen 11 yıl önce
ebeveyn
işleme
67e7db35a6
1 değiştirilmiş dosya ile 15 ekleme ve 0 silme
  1. +15
    -0
      Audio.h

+ 15
- 0
Audio.h Dosyayı Görüntüle

@@ -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];

Yükleniyor…
İptal
Kaydet