# HG changeset patch # User Giulio Moro # Date 1456140501 0 # Node ID ec9425f728bcef6a9371af5d652f4cf33db7fded # Parent 6a23c07d0fbb94512bd216b0926ac03031c28c5c Removed redundant calls to pinModeFrame. Closes #1623. diff -r 6a23c07d0fbb -r ec9425f728bc projects/basic_button/render.cpp --- a/projects/basic_button/render.cpp Sun Feb 14 01:09:23 2016 +0000 +++ b/projects/basic_button/render.cpp Mon Feb 22 11:28:21 2016 +0000 @@ -20,6 +20,10 @@ bool setup(BeagleRTContext *context, void *userData) { + for(unsigned int n=0; ndigitalFrames; n++){ + pinModeFrame(context, 0, P8_08, INPUT); + pinModeFrame(context, 0, P8_07, OUTPUT); + } return true; } @@ -39,11 +43,9 @@ void render(BeagleRTContext *context, void *userData) { for(unsigned int n=0; ndigitalFrames; n++){ - pinModeFrame(context, 0, P8_08, INPUT); - int status=digitalReadFrame(context, 0, P8_08); //read the value of the button - pinModeFrame(context, 0, P8_07, OUTPUT); - digitalWriteFrame(context, n, P8_07, status); //write the status to the LED - } + int status=digitalReadFrame(context, 0, P8_08); //read the value of the button + digitalWriteFrame(context, n, P8_07, status); //write the status to the LED + } } // cleanup() is called once at the end, after the audio has stopped.