File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1414#ifndef ROUTER_BRIDGE_H
1515#define ROUTER_BRIDGE_H
1616
17+ #define CTRL_GPIOG_13_ID 0
18+
1719#define RESET_METHOD " $/reset"
1820#define BIND_METHOD " $/register"
1921// #define BRIDGE_ERROR "$/bridgeLog"
2426#define DEFAULT_SERIAL_BAUD 115200
2527
2628#include < zephyr/kernel.h>
29+ #include < zephyr/devicetree.h>
30+ #include < zephyr/drivers/gpio.h>
2731#include < Arduino_RPClite.h>
2832
2933
@@ -139,6 +143,14 @@ class BridgeClass {
139143
140144 if (is_started ()) return true ;
141145
146+ const struct gpio_dt_spec mpu_boot_pin = GPIO_DT_SPEC_GET_BY_IDX (DT_PATH (zephyr_user), control_gpios, CTRL_GPIOG_13_ID);
147+
148+ gpio_pin_configure_dt (&mpu_boot_pin, GPIO_INPUT | GPIO_PULL_DOWN);
149+ k_sleep (K_MSEC (200 ));
150+ while (gpio_pin_get_dt (&mpu_boot_pin) == 0 ) {
151+ k_sleep (K_MSEC (10 ));
152+ }
153+
142154 serial_ptr->begin (baud);
143155 transport = new SerialTransport (*serial_ptr);
144156
You can’t perform that action at this time.
0 commit comments