fix(gpio): improve set level performance

by avoid "read-modify-write" operation. The registers designed to be
write only.

Related to https://github.com/espressif/esp-idf/issues/14674
This commit is contained in:
morris
2024-11-07 16:27:55 +08:00
parent 87af41852e
commit bde65f22fc
10 changed files with 28 additions and 28 deletions

View File

@@ -314,9 +314,9 @@ __attribute__((always_inline))
static inline void gpio_ll_set_level(gpio_dev_t *hw, uint32_t gpio_num, uint32_t level)
{
if (level) {
hw->out_w1ts.out_w1ts = (1 << gpio_num);
hw->out_w1ts.val = 1 << gpio_num;
} else {
hw->out_w1tc.out_w1tc = (1 << gpio_num);
hw->out_w1tc.val = 1 << gpio_num;
}
}