comparison core/Utilities.cpp @ 72:d837fb676977

Documentation updates and include Arduino-type constants in Utilities.h
author andrewm
date Fri, 17 Jul 2015 20:09:50 +0100
parents a6d223473ea2
children 8bd351ca8b46
comparison
equal deleted inserted replaced
71:53e57276ac1a 72:d837fb676977
66 // pinModeFrame() 66 // pinModeFrame()
67 // 67 //
68 // Sets the direction of a digital pin for the current frame and all subsequent frames 68 // Sets the direction of a digital pin for the current frame and all subsequent frames
69 void pinModeFrame(BeagleRTContext *context, int frame, int channel, int mode) { 69 void pinModeFrame(BeagleRTContext *context, int frame, int channel, int mode) {
70 for(unsigned int f = frame; f < context->digitalFrames; f++) { 70 for(unsigned int f = frame; f < context->digitalFrames; f++) {
71 if(mode) 71 if(mode == OUTPUT)
72 context->digital[f] |= (1 << channel); 72 context->digital[f] |= (1 << channel);
73 else 73 else
74 context->digital[f] &= ~(1 << channel); 74 context->digital[f] &= ~(1 << channel);
75 } 75 }
76 } 76 }
77 77
78 // pinModeFrameOnce() 78 // pinModeFrameOnce()
79 // 79 //
80 // Sets the direction of a digital pin for the current frame only 80 // Sets the direction of a digital pin for the current frame only
81 void pinModeFrameOnce(BeagleRTContext *context, int frame, int channel, int mode) { 81 void pinModeFrameOnce(BeagleRTContext *context, int frame, int channel, int mode) {
82 if(mode) 82 if(mode == OUTPUT)
83 context->digital[frame] |= (1 << channel); 83 context->digital[frame] |= (1 << channel);
84 else 84 else
85 context->digital[frame] &= ~(1 << channel); 85 context->digital[frame] &= ~(1 << channel);
86 } 86 }
87 87