Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#ifndef ROUTER_BRIDGE_H
#define ROUTER_BRIDGE_H

#define CTRL_GPIOG_13_ID 0

#define RESET_METHOD "$/reset"
#define BIND_METHOD "$/register"
//#define BRIDGE_ERROR "$/bridgeLog"
Expand All @@ -24,6 +26,8 @@
#define DEFAULT_SERIAL_BAUD 115200

#include <zephyr/kernel.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <Arduino_RPClite.h>


Expand Down Expand Up @@ -139,6 +143,14 @@ class BridgeClass {

if (is_started()) return true;

const struct gpio_dt_spec mpu_boot_pin = GPIO_DT_SPEC_GET_BY_IDX(DT_PATH(zephyr_user), control_gpios, CTRL_GPIOG_13_ID);

gpio_pin_configure_dt(&mpu_boot_pin, GPIO_INPUT | GPIO_PULL_DOWN);
k_sleep(K_MSEC(200));
while (gpio_pin_get_dt(&mpu_boot_pin) == 0) {
k_sleep(K_MSEC(10));
}

serial_ptr->begin(baud);
transport = new SerialTransport(*serial_ptr);

Expand Down