Skip to content

Instantly share code, notes, and snippets.

Created November 29, 2016 06:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tomerweller/7f9f202858cb064c84722c72f6c20aee to your computer and use it in GitHub Desktop.
esp32 freertos ring oscillator benchmark
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "nvs_flash.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
#define IN_GPIO 13
#define OUT_GPIO 14
void ring_oscillator(void *pvParameter)
gpio_set_direction(IN_GPIO, GPIO_MODE_INPUT);
gpio_set_direction(OUT_GPIO, GPIO_MODE_OUTPUT);
while(1) {
gpio_set_level(OUT_GPIO, 1-gpio_get_level(IN_GPIO));
void app_main()
xTaskCreate(&ring_oscillator, "ring_oscillator", 512, NULL, 5, NULL);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment