Dual-board IDF v5.4 layout with board components, motor EN safe state on WROOM, TWDT left enabled. Local idf.py verify blocked: no IDF_PATH or espressif/idf:v5.4 image in this environment.
29 lines
705 B
C
29 lines
705 B
C
#include "board.h"
|
|
#include "esp_log.h"
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/task.h"
|
|
|
|
static const char *TAG = "app";
|
|
|
|
void app_main(void)
|
|
{
|
|
ESP_LOGI(TAG, "board=%s", board_name());
|
|
|
|
gpio_num_t en_pin = board_pin_motor_en();
|
|
if (en_pin != GPIO_NUM_NC) {
|
|
gpio_config_t io = {
|
|
.pin_bit_mask = 1ULL << en_pin,
|
|
.mode = GPIO_MODE_OUTPUT,
|
|
.pull_up_en = GPIO_PULLUP_DISABLE,
|
|
.pull_down_en = GPIO_PULLDOWN_DISABLE,
|
|
.intr_type = GPIO_INTR_DISABLE,
|
|
};
|
|
gpio_config(&io);
|
|
gpio_set_level(en_pin, board_motor_en_disable_level());
|
|
}
|
|
|
|
while (1) {
|
|
vTaskDelay(pdMS_TO_TICKS(1000));
|
|
}
|
|
}
|