comparison core/PRU.cpp @ 56:3c3a1357657d newapi

Further API update to name three primary functions setup(), render() and cleanup(). Changed include paths so now can #include <BeagleRT.h>. Removed stale pru_rtaudio.bin file as this is now done as pru_rtaudio_bin.h. Updated examples to new API and fixed minor compiler warnings along the way. Network example needs further attention to compile.
author andrewm
date Wed, 15 Jul 2015 12:10:51 +0100
parents a6d223473ea2
children 92145ba7aabf
comparison
equal deleted inserted replaced
55:41d24dba6b74 56:3c3a1357657d
428 #endif 428 #endif
429 429
430 float *lastAnalogOutFrame; 430 float *lastAnalogOutFrame;
431 uint32_t *digitalBuffer0, *digitalBuffer1, *lastDigitalBuffer; 431 uint32_t *digitalBuffer0, *digitalBuffer1, *lastDigitalBuffer;
432 uint32_t pru_audio_offset, pru_spi_offset; 432 uint32_t pru_audio_offset, pru_spi_offset;
433 int result;
434 433
435 // Allocate audio buffers 434 // Allocate audio buffers
436 context->audioIn = (float *)malloc(2 * context->audioFrames * sizeof(float)); 435 context->audioIn = (float *)malloc(2 * context->audioFrames * sizeof(float));
437 context->audioOut = (float *)malloc(2 * context->audioFrames * sizeof(float)); 436 context->audioOut = (float *)malloc(2 * context->audioFrames * sizeof(float));
438 if(context->audioIn == 0 || context->audioOut == 0) { 437 if(context->audioIn == 0 || context->audioOut == 0) {
472 471
473 // TESTING 472 // TESTING
474 // uint32_t testCount = 0; 473 // uint32_t testCount = 0;
475 // RTIME startTime = rt_timer_read(); 474 // RTIME startTime = rt_timer_read();
476 475
477 #ifndef BEAGLERT_USE_XENOMAI_INTERRUPTS 476 #ifdef BEAGLERT_USE_XENOMAI_INTERRUPTS
477 int result;
478 #else
478 // Which buffer the PRU was last processing 479 // Which buffer the PRU was last processing
479 uint32_t lastPRUBuffer = 0; 480 uint32_t lastPRUBuffer = 0;
480 #endif 481 #endif
481 482
482 while(!gShouldStop) { 483 while(!gShouldStop) {