Mercurial > hg > beaglert
comparison core/RTAudio.cpp @ 15:901d205d1a3c
Updated to latest PRU library; external PRU file no longer needed. Also catch SIGTERM as well as SIGINT to clean up gracefully.
author | andrewm |
---|---|
date | Sat, 07 Feb 2015 16:41:56 +0000 |
parents | 6adb088196a7 |
children | 670be80463a3 |
comparison
equal
deleted
inserted
replaced
14:06f93bef7dd2 | 15:901d205d1a3c |
---|---|
55 // Flag which tells the audio task to stop | 55 // Flag which tells the audio task to stop |
56 bool gShouldStop = false; | 56 bool gShouldStop = false; |
57 | 57 |
58 // general settings | 58 // general settings |
59 int gRTAudioVerbose = 0; // Verbosity level for debugging | 59 int gRTAudioVerbose = 0; // Verbosity level for debugging |
60 char gPRUFilename[256] = "pru_rtaudio.bin"; // path to PRU binary file | |
61 int gAmplifierMutePin = -1; | 60 int gAmplifierMutePin = -1; |
62 int gAmplifierShouldBeginMuted = 0; | 61 int gAmplifierShouldBeginMuted = 0; |
63 | 62 |
64 // Number of audio and matrix channels, globally accessible | 63 // Number of audio and matrix channels, globally accessible |
65 // At least gNumMatrixChannels needs to be global to be used | 64 // At least gNumMatrixChannels needs to be global to be used |
207 if(gAudioCodec->startAudio(0)) { | 206 if(gAudioCodec->startAudio(0)) { |
208 rt_printf("Error: unable to start I2C audio codec\n"); | 207 rt_printf("Error: unable to start I2C audio codec\n"); |
209 gShouldStop = 1; | 208 gShouldStop = 1; |
210 } | 209 } |
211 else { | 210 else { |
212 if(gPRU->start(gPRUFilename)) { | 211 if(gPRU->start()) { |
213 rt_printf("Error: unable to start PRU from file %s\n", gPRUFilename); | 212 rt_printf("Error: unable to start PRU\n"); |
214 gShouldStop = 1; | 213 gShouldStop = 1; |
215 } | 214 } |
216 else { | 215 else { |
217 // All systems go. Run the loop; it will end when gShouldStop is set to 1 | 216 // All systems go. Run the loop; it will end when gShouldStop is set to 1 |
218 | 217 |