rpi_gpio 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/ext/rpi_gpio/rb_gpio.c +7 -0
- data/lib/rpi_gpio.so +0 -0
- metadata +1 -1
data/README.md
CHANGED
data/ext/rpi_gpio/rb_gpio.c
CHANGED
@@ -221,6 +221,10 @@ VALUE GPIO_setup(VALUE self, VALUE channel, VALUE hash)
|
|
221
221
|
const char *pud_str = NULL;
|
222
222
|
int pud = PUD_OFF;
|
223
223
|
int func;
|
224
|
+
|
225
|
+
VALUE initialize_val = Qnil;
|
226
|
+
const char *initialize_str = NULL;
|
227
|
+
int initialize = HIGH;
|
224
228
|
|
225
229
|
// func to set up channel stored in channel variable
|
226
230
|
int setup_one(void) {
|
@@ -249,6 +253,9 @@ VALUE GPIO_setup(VALUE self, VALUE channel, VALUE hash)
|
|
249
253
|
}
|
250
254
|
}
|
251
255
|
|
256
|
+
if (direction == OUTPUT && (initialize == LOW || initialize == HIGH)) {
|
257
|
+
output_gpio(gpio, initialize);
|
258
|
+
}
|
252
259
|
setup_gpio(gpio, direction, pud);
|
253
260
|
gpio_direction[gpio] = direction;
|
254
261
|
return 1;
|
data/lib/rpi_gpio.so
CHANGED
Binary file
|