Mercurial > hg > beaglert
diff include/Utilities.h @ 23:182ae9367104 matrix_gpio
- persistency: the last frame of each digital and analogOut buffers is used to initialize all the frames in the next buffer. This means that once a value is set, the pin will hold the value until you change it
- AnalogXyz macros have been renamed to analogXyz
- the short option -P has been removed. The long option --pru-file has to be used instead
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Tue, 05 May 2015 17:28:00 +0100 |
parents | c98863e63174 |
children | 83baffda5786 |
line wrap: on
line diff
--- a/include/Utilities.h Sun May 03 01:10:17 2015 +0100 +++ b/include/Utilities.h Tue May 05 17:28:00 2015 +0100 @@ -14,13 +14,13 @@ // Macros for accessing the analog values: usable _only_ within render() // Read an Analog input from input pin p at frame f -#define AnalogRead(p, f) (analogIn[(f)*gNumAnalogChannels + (p)]) +#define analogRead(p, f) (analogIn[(f)*gNumAnalogChannels + (p)]) // Write an Analog output frame at output pin p, frame f, to value v -#define AnalogWriteFrame(p, f, v) (analogOut[(f)*gNumAnalogChannels + (p)] = (v)) -#define AnalogWrite(pin, frame, value) \ +#define analogWriteFrame(p, f, v) (analogOut[(f)*gNumAnalogChannels + (p)] = (v)) +#define analogWrite(pin, frame, value) \ (({do {\ for (int _privateI=(frame); _privateI<numAnalogFrames; _privateI++){ \ - AnalogWriteFrame(pin,_privateI,value); \ + analogWriteFrame(pin,_privateI,value); \ }\ } while (0);}),(void)0)\