Skip to content

Commit c2e69ca

Browse files
committed
Fix HIGH and LOW constants
1 parent 6c1e6da commit c2e69ca

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

mrblib/gpio.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ module ESP32
22
include Constants
33

44
module GPIO
5+
HIGH = ESP32::GPIO_HIGH
6+
LOW = ESP32::GPIO_LOW
7+
58
INPUT = ESP32::GPIO_MODE_INPUT
69
OUTPUT = ESP32::GPIO_MODE_OUTPUT
710
INPUT_PULLUP = ESP32::GPIO_MODE_INPUT_PULLUP
@@ -12,6 +15,9 @@ module GPIO
1215
OUTPUT_OD = ESP32::GPIO_MODE_OUTPUT_OD
1316

1417
class Pin
18+
HIGH = ESP32::GPIO_HIGH
19+
LOW = ESP32::GPIO_LOW
20+
1521
PIN_MODE = {
1622
input: ESP32::GPIO_MODE_INPUT,
1723
output: ESP32::GPIO_MODE_OUTPUT,

src/gpio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ mrb_mruby_esp32_gpio_gem_init(mrb_state* mrb) {
314314
define_const(DAC_CHANNEL_2);
315315
#endif
316316

317-
mrb_define_const(mrb, constants, "LOW", mrb_fixnum_value(0));
318-
mrb_define_const(mrb, constants, "HIGH", mrb_fixnum_value(1));
317+
mrb_define_const(mrb, constants, "GPIO_LOW", mrb_fixnum_value(0));
318+
mrb_define_const(mrb, constants, "GPIO_HIGH", mrb_fixnum_value(1));
319319

320320
define_const(GPIO_MODE_INPUT);
321321
define_const(GPIO_MODE_OUTPUT);

0 commit comments

Comments
 (0)