/* --------------------------------------------------------------
Application: 01 - Rev1
Release Type: Sub - Optimal Baseline Code
Class: Real Time Systems - Su 2025
AI Use: Commented inline
---------------------------------------------------------------*/
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#define LED_PIN GPIO_NUM_2
void longprint(){
printf("Status: system running\t");
// Delay ~1000 ms for next print (and LED toggle)
vTaskDelay(pdMS_TO_TICKS(10000));
}
void app_main() {
gpio_reset_pin(LED_PIN);
gpio_set_direction(LED_PIN, GPIO_MODE_OUTPUT);
int ledState = 0;
while (1) {
// Toggle LED state
ledState = !ledState;
gpio_set_level(LED_PIN, ledState);
// Intended LED on or off duration: 250 ms
vTaskDelay(pdMS_TO_TICKS(250));
printf("leg toggle\t time=%lu ms\n", (unsigned long)(xTaskGetTickCount()*portTICK_PERIOD_MS));
// Print message
longprint();
}
}