Skip to content

Commit 189fe96

Browse files
authored
Correct level value in gpio.trig() callback (#2883)
2 parents 43588c1 + b4c94fa commit 189fe96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/modules/gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static void nodemcu_gpio_callback_task (task_param_t param, task_prio_t prio)
216216
{
217217
(void)prio;
218218
uint32_t gpio = (uint32_t)param & 0xffu;
219-
int level = ((int)param) & 0x100u;
219+
int level = (((int)param) & 0x100u) >> 8;
220220

221221
lua_State *L = lua_getstate ();
222222
if (gpio_cb_refs[gpio] != LUA_NOREF)

0 commit comments

Comments
 (0)