Mercurial > hg > beaglert
changeset 223:ec9425f728bc mergingClockSync
Removed redundant calls to pinModeFrame. Closes #1623.
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Mon, 22 Feb 2016 11:28:21 +0000 |
parents | 6a23c07d0fbb |
children | 97faaf985164 |
files | projects/basic_button/render.cpp |
diffstat | 1 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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; n<context->digitalFrames; 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; n<context->digitalFrames; 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.