| 14 | constexpr auto TDECK_POWERON_GPIO = GPIO_NUM_10; |
| 15 | |
| 16 | static bool powerOn() { |
| 17 | gpio_config_t device_power_signal_config = { |
| 18 | .pin_bit_mask = BIT64(TDECK_POWERON_GPIO), |
| 19 | .mode = GPIO_MODE_OUTPUT, |
| 20 | .pull_up_en = GPIO_PULLUP_DISABLE, |
| 21 | .pull_down_en = GPIO_PULLDOWN_DISABLE, |
| 22 | .intr_type = GPIO_INTR_DISABLE, |
| 23 | }; |
| 24 | |
| 25 | if (gpio_config(&device_power_signal_config) != ESP_OK) { |
| 26 | return false; |
| 27 | } |
| 28 | |
| 29 | if (gpio_set_level(TDECK_POWERON_GPIO, 1) != ESP_OK) { |
| 30 | return false; |
| 31 | } |
| 32 | |
| 33 | // Avoids crash when no SD card is inserted. It's unknown why, but likely is related to power draw. |
| 34 | tt::kernel::delayMillis(100); |
| 35 | |
| 36 | return true; |
| 37 | } |
| 38 | |
| 39 | bool initBoot() { |
| 40 | LOGGER.info(LOG_MESSAGE_POWER_ON_START); |
no test coverage detected