diff core/Utilities.cpp @ 75:8bd351ca8b46

Fixed direction in setPinMode functions, updated and fixed basic_blink
author Giulio Moro <giuliomoro@yahoo.it>
date Fri, 17 Jul 2015 20:59:43 +0100
parents d837fb676977
children f1012082f142
line wrap: on
line diff
--- a/core/Utilities.cpp	Fri Jul 17 20:23:38 2015 +0100
+++ b/core/Utilities.cpp	Fri Jul 17 20:59:43 2015 +0100
@@ -68,7 +68,7 @@
 // Sets the direction of a digital pin for the current frame and all subsequent frames
 void pinModeFrame(BeagleRTContext *context, int frame, int channel, int mode) {
 	for(unsigned int f = frame; f < context->digitalFrames; f++) {
-		if(mode == OUTPUT)
+		if(mode == INPUT)
 			context->digital[f] |= (1 << channel);
 		else
 			context->digital[f] &= ~(1 << channel);
@@ -79,7 +79,7 @@
 //
 // Sets the direction of a digital pin for the current frame only
 void pinModeFrameOnce(BeagleRTContext *context, int frame, int channel, int mode) {
-	if(mode == OUTPUT)
+	if(mode == INPUT)
 		context->digital[frame] |= (1 << channel);
 	else
 		context->digital[frame] &= ~(1 << channel);