diff --git a/src/platforms/esp32/components/avm_builtins/gpio_driver.c b/src/platforms/esp32/components/avm_builtins/gpio_driver.c index ef0279044..4a3bd38d3 100644 --- a/src/platforms/esp32/components/avm_builtins/gpio_driver.c +++ b/src/platforms/esp32/components/avm_builtins/gpio_driver.c @@ -463,11 +463,11 @@ static term gpiodriver_set_int(Context *ctx, int32_t target_pid, term cmd) term trigger = term_get_tuple_element(cmd, 2); if (term_get_tuple_arity(cmd) == 4) { term pid = term_get_tuple_element(cmd, 3); - if (UNLIKELY(!term_is_pid(pid) && !term_is_atom(pid))) { + if (UNLIKELY(!term_is_local_pid(pid) && !term_is_atom(pid))) { ESP_LOGE(TAG, "Invalid listener parameter, must be a pid() or registered process!"); return ERROR_ATOM; } - if (term_is_pid(pid)) { + if (term_is_local_pid(pid)) { target_local_pid = term_to_local_process_id(pid); } else { int pid_atom_index = term_to_atom_index(pid); diff --git a/src/platforms/esp32/components/avm_builtins/i2c_driver.c b/src/platforms/esp32/components/avm_builtins/i2c_driver.c index 4f53c13a4..7ef7acb94 100644 --- a/src/platforms/esp32/components/avm_builtins/i2c_driver.c +++ b/src/platforms/esp32/components/avm_builtins/i2c_driver.c @@ -633,8 +633,8 @@ static NativeHandlerResult i2cdriver_consume_mailbox(Context *ctx) I2CAcquireResult i2c_driver_acquire(term i2c_port, i2c_port_t *i2c_num, GlobalContext *global) { - if (UNLIKELY(!term_is_pid(i2c_port))) { - ESP_LOGW(TAG, "acquire: given term is not a PID."); + if (UNLIKELY(!term_is_local_port(i2c_port))) { + ESP_LOGW(TAG, "acquire: given term is not a port."); return I2CAcquireInvalidPeripheral; } @@ -660,7 +660,7 @@ I2CAcquireResult i2c_driver_acquire(term i2c_port, i2c_port_t *i2c_num, GlobalCo void i2c_driver_release(term i2c_port, GlobalContext *global) { - if (UNLIKELY(!term_is_pid(i2c_port))) { + if (UNLIKELY(!term_is_local_port(i2c_port))) { ESP_LOGW(TAG, "release: given term is not a PID."); return; } diff --git a/src/platforms/esp32/components/avm_builtins/socket_driver.c b/src/platforms/esp32/components/avm_builtins/socket_driver.c index 6cec74abb..37f0aa45f 100644 --- a/src/platforms/esp32/components/avm_builtins/socket_driver.c +++ b/src/platforms/esp32/components/avm_builtins/socket_driver.c @@ -858,7 +858,7 @@ static void do_connect(Context *ctx, const GenMessage *gen_message) term active_term = interop_proplist_get_value_default(params, ACTIVE_ATOM, TRUE_ATOM); term controlling_process_term = interop_proplist_get_value(params, CONTROLLING_PROCESS_ATOM); - bool ok = term_is_pid(controlling_process_term); + bool ok = term_is_local_pid(controlling_process_term); if (UNLIKELY(!ok)) { do_send_error_reply(ctx, ERR_ARG, ref_ticks, pid); return; @@ -1022,7 +1022,7 @@ void do_udp_open(Context *ctx, const GenMessage *gen_message) term active_term = interop_proplist_get_value_default(params, ACTIVE_ATOM, TRUE_ATOM); term controlling_process_term = interop_proplist_get_value(params, CONTROLLING_PROCESS_ATOM); - bool ok = term_is_pid(controlling_process_term); + bool ok = term_is_local_pid(controlling_process_term); if (UNLIKELY(!ok)) { do_send_error_reply(ctx, ERR_ARG, ref_ticks, pid); return; @@ -1369,7 +1369,7 @@ static void do_controlling_process(Context *ctx, const GenMessage *gen_message) return; } term new_pid_term = term_get_tuple_element(gen_message->req, 1); - if (UNLIKELY(!term_is_pid(new_pid_term))) { + if (UNLIKELY(!term_is_local_pid(new_pid_term))) { do_send_error_reply(ctx, ERR_ARG, ref_ticks, pid); } else { term return_msg; diff --git a/src/platforms/esp32/components/avm_builtins/spi_driver.c b/src/platforms/esp32/components/avm_builtins/spi_driver.c index 45e295288..d315ef144 100644 --- a/src/platforms/esp32/components/avm_builtins/spi_driver.c +++ b/src/platforms/esp32/components/avm_builtins/spi_driver.c @@ -677,7 +677,7 @@ static NativeHandlerResult spidriver_consume_mailbox(Context *ctx) bool spi_driver_get_peripheral(term spi_port, spi_host_device_t *host_dev, GlobalContext *global) { - if (UNLIKELY(!term_is_pid(spi_port))) { + if (UNLIKELY(!term_is_local_port(spi_port))) { ESP_LOGW(TAG, "Given term is not a SPI port driver."); return false; }