#ifndef COMPLIB_SERVER_RESET_HPP #define COMPLIB_SERVER_RESET_HPP #include #define RESET_PIN 23 #define BOOT_PIN 17 #define RESET_SLEEP_TIME_US 1000 * 100 #define RESET_STARTUP_SLEEP_TIME_US 1000 * 500 namespace Reset { void reset_robot() { gpioInitialise(); gpioSetMode(BOOT_PIN, PI_OUTPUT); gpioSetMode(RESET_PIN, PI_OUTPUT); gpioWrite(BOOT_PIN, 0); gpioWrite(RESET_PIN, 0); usleep(RESET_SLEEP_TIME_US); gpioWrite(RESET_PIN, 1); usleep(RESET_STARTUP_SLEEP_TIME_US); } } #endif //COMPLIB_SERVER_RESET_HPP