From 7a806b599c1750525ba27ea37efa525ac4c6fb54 Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Fri, 9 Jul 2021 22:51:37 -0700 Subject: [PATCH] Avoid gpio_intr_disable collision by prefixing constants with #. --- ueforth/esp32/bindings.fs | 15 ++++++++------- ueforth/site/ESP32forth.html | 12 ++++++------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ueforth/esp32/bindings.fs b/ueforth/esp32/bindings.fs index 1621930..d439119 100644 --- a/ueforth/esp32/bindings.fs +++ b/ueforth/esp32/bindings.fs @@ -137,16 +137,17 @@ transfer{ 1 10 lshift constant ESP_INTR_FLAG_IRAM 1 11 lshift constant ESP_INTR_FLAG_INTRDISABLED -0 constant GPIO_INTR_DISABLE -1 constant GPIO_INTR_POSEDGE -2 constant GPIO_INTR_NEGEDGE -3 constant GPIO_INTR_ANYEDGE -4 constant GPIO_INTR_LOW_LEVEL -5 constant GPIO_INTR_HIGH_LEVEL +( Prefix these with # because GPIO_INTR_DISABLE conflicts with a function. ) +0 constant #GPIO_INTR_DISABLE +1 constant #GPIO_INTR_POSEDGE +2 constant #GPIO_INTR_NEGEDGE +3 constant #GPIO_INTR_ANYEDGE +4 constant #GPIO_INTR_LOW_LEVEL +5 constant #GPIO_INTR_HIGH_LEVEL ( Easy word to trigger on any change to a pin ) ESP_INTR_FLAG_DEFAULT gpio_install_isr_service drop -: pinchange ( xt pin ) dup GPIO_INTR_ANYEDGE gpio_set_intr_type throw +: pinchange ( xt pin ) dup #GPIO_INTR_ANYEDGE gpio_set_intr_type throw swap 0 gpio_isr_handler_add throw ; forth definitions diff --git a/ueforth/site/ESP32forth.html b/ueforth/site/ESP32forth.html index f0741d0..0ae6801 100644 --- a/ueforth/site/ESP32forth.html +++ b/ueforth/site/ESP32forth.html @@ -347,12 +347,12 @@ pinchange ( xt pin -- ) Call xt when pin changes. ESP_INTR_FLAG_DEFAULT -- Default handler allows per pin routing Various triggers: - GPIO_INTR_DISABLE - GPIO_INTR_POSEDGE - GPIO_INTR_NEGEDGE - GPIO_INTR_ANYEDGE - GPIO_INTR_LOW_LEVEL - GPIO_INTR_HIGH_LEVEL + #GPIO_INTR_DISABLE + #GPIO_INTR_POSEDGE + #GPIO_INTR_NEGEDGE + #GPIO_INTR_ANYEDGE + #GPIO_INTR_LOW_LEVEL + #GPIO_INTR_HIGH_LEVEL gpio_config ( gpio_config_t* -- 0/err ) gpio_reset_pin ( pin -- 0/err )