Merge branch 'bugfix/gpio_reset_bitmask_v3.1' into 'release/v3.1'
gpio: Bitmask overflow fix in gpio_reset_pin (backport v3.1) See merge request idf/esp-idf!3005
This commit is contained in:
commit
2e60a4b751
|
@ -316,7 +316,7 @@ esp_err_t gpio_reset_pin(gpio_num_t gpio_num)
|
||||||
{
|
{
|
||||||
assert(gpio_num >= 0 && GPIO_IS_VALID_GPIO(gpio_num));
|
assert(gpio_num >= 0 && GPIO_IS_VALID_GPIO(gpio_num));
|
||||||
gpio_config_t cfg = {
|
gpio_config_t cfg = {
|
||||||
.pin_bit_mask = BIT(gpio_num),
|
.pin_bit_mask = BIT64(gpio_num),
|
||||||
.mode = GPIO_MODE_DISABLE,
|
.mode = GPIO_MODE_DISABLE,
|
||||||
//for powersave reasons, the GPIO should not be floating, select pullup
|
//for powersave reasons, the GPIO should not be floating, select pullup
|
||||||
.pull_up_en = true,
|
.pull_up_en = true,
|
||||||
|
|
|
@ -133,6 +133,7 @@
|
||||||
|
|
||||||
#ifndef __ASSEMBLER__
|
#ifndef __ASSEMBLER__
|
||||||
#define BIT(nr) (1UL << (nr))
|
#define BIT(nr) (1UL << (nr))
|
||||||
|
#define BIT64(nr) (1ULL << (nr))
|
||||||
#else
|
#else
|
||||||
#define BIT(nr) (1 << (nr))
|
#define BIT(nr) (1 << (nr))
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue