Mercurial > hg > beaglert
comparison core/RTAudio.cpp @ 175:9bfe04d184fb experimental-fixing-AuxiliaryTask
Demonstrates issue #1374
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Mon, 28 Dec 2015 15:00:34 +0100 |
parents | 1e629f126322 |
children |
comparison
equal
deleted
inserted
replaced
174:1e629f126322 | 175:9bfe04d184fb |
---|---|
58 PRU *gPRU = 0; | 58 PRU *gPRU = 0; |
59 I2c_Codec *gAudioCodec = 0; | 59 I2c_Codec *gAudioCodec = 0; |
60 | 60 |
61 vector<InternalAuxiliaryTask*> gAuxTasks; | 61 vector<InternalAuxiliaryTask*> gAuxTasks; |
62 | 62 |
63 void dumpAuxTasks(){ | |
64 printf("Aux tasks:\n"); | |
65 printf("size: %d\n", gAuxTasks.size()); | |
66 vector<InternalAuxiliaryTask*>::iterator it; | |
67 for(it = gAuxTasks.begin(); it != gAuxTasks.end(); it++) { | |
68 InternalAuxiliaryTask* task = *it; | |
69 printf("[%d] Name: %s\n", it-gAuxTasks.begin(), task->name); | |
70 } | |
71 printf("----------\n\n"); | |
72 } | |
63 // Flag which tells the audio task to stop | 73 // Flag which tells the audio task to stop |
64 bool gShouldStop = false; | 74 bool gShouldStop = false; |
65 | 75 |
66 // general settings | 76 // general settings |
67 char gPRUFilename[MAX_PRU_FILENAME_LENGTH]; // Path to PRU binary file (internal code if empty)_ | 77 char gPRUFilename[MAX_PRU_FILENAME_LENGTH]; // Path to PRU binary file (internal code if empty)_ |
87 // | 97 // |
88 // Returns 0 on success. | 98 // Returns 0 on success. |
89 | 99 |
90 int BeagleRT_initAudio(BeagleRTInitSettings *settings, void *userData) | 100 int BeagleRT_initAudio(BeagleRTInitSettings *settings, void *userData) |
91 { | 101 { |
102 printf("initaudio\n"); | |
103 dumpAuxTasks(); | |
92 rt_print_auto_init(1); | 104 rt_print_auto_init(1); |
93 | 105 |
94 BeagleRT_setVerboseLevel(settings->verbose); | 106 BeagleRT_setVerboseLevel(settings->verbose); |
95 strncpy(gPRUFilename, settings->pruFilename, MAX_PRU_FILENAME_LENGTH); | 107 strncpy(gPRUFilename, settings->pruFilename, MAX_PRU_FILENAME_LENGTH); |
96 gUserData = userData; | 108 gUserData = userData; |
437 // Free the name string and the struct itself | 449 // Free the name string and the struct itself |
438 free(taskStruct->name); | 450 free(taskStruct->name); |
439 free(taskStruct); | 451 free(taskStruct); |
440 } | 452 } |
441 gAuxTasks.clear(); | 453 gAuxTasks.clear(); |
454 printf("CLEARED_-------------------------------------\n"); | |
442 | 455 |
443 // Delete the audio task and its interrupt | 456 // Delete the audio task and its interrupt |
444 #ifdef BEAGLERT_USE_XENOMAI_INTERRUPTS | 457 #ifdef BEAGLERT_USE_XENOMAI_INTERRUPTS |
445 rt_intr_delete(&gRTAudioInterrupt); | 458 rt_intr_delete(&gRTAudioInterrupt); |
446 #endif | 459 #endif |