Hi TJF, I've the same problem as Niro. So I've modified the file you talked about. I also follow the instructions on your site to rebuild `libpruio.so`:
cd pruio vim pruio_adc.bas (edit buggy lines) ./make.sh ./build.sh After the build command a file named `libpruio.so` appear in the current directory. The problem is that *I can't use that library to compile anything.* If I try to compile some of the examples shipped with the library I got the annoying error sos.c:(.text+0x128): undefined reference to `pruio_new' etc I'm doing something wrong? Thanks, Andrea Il giorno venerdì 7 novembre 2014 00:18:55 UTC+1, [email protected] ha scritto: > > Hey TJF, > > I've got it compiled and working. I can't yet test if the adc keeps up > since I the function generator we've ordered got out of stock.... However I > changed my code a bit so it would close the files and the whole program has > a end statement. It's currently 1 channel at ~220 kS/s. I haven't pushed it > further because I don't know what will happen. With my understanding of the > PRU I guess the PRU can't break anything on the BBB while doing that, but I > don't know so I don't want to push my luck. > > #include "unistd.h" > #include "stdio.h" > #include "../c_wrapper/pruio.h" > > > //! The main function. > int main(int argc, char **argv) > { > FILE* oFile; > uint8 bDiv = 4, bStep; > uint32 bSize = 1e6; > uint32 bsSize = bSize/bDiv; > uint8 cycles = 2; > char fName[12]; > int i = 0; > > > pruIo *io = pruio_new(PRUIO_DEF_ACTIVE, 0x98, 0, 1); //! create new > driver structure > pruio_adc_setStep(io, 9, 4, 0, 0, 0); // step 9 for AIN-4 > if (pruio_config(io, bSize, 1 << 9, 4545, 0)){ // '1 << 9' -> step 9, > '6285' ns -> 159.1 kHz > printf("config failed (%s)\n", io->Errr);} > else{ > pruio_rb_start(io); > sleep(1); > for(i=0; i<cycles; i++){ > sprintf(fName, "output.%u",i); > oFile = fopen(fName,"wb"); > while(bStep<bDiv){ > while(io->DRam[0] < (bStep+1) * bsSize && io->DRam[0] > bStep * > bsSize){ > sleep(1); > } > printf("writing samples %u-%u\n",bStep*bsSize, (bStep+1)*bsSize); > fwrite(io->Adc->Value, sizeof(uint16), 16000, oFile); > bStep++; > } > bStep=0; > fclose(oFile); > } > } > pruio_destroy(io); > return 0; > } > > > Greetings, > Nils Kohrs > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
