Avoid gpio_intr_disable collision by prefixing constants with #.
This commit is contained in:
@ -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
|
||||
|
||||
@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user