ReactESP 1.0.0
Asynchronous programming for the ESP microcontrollers
main.cpp File Reference
#include <Arduino.h>
#include <ReactESP.h>
Include dependency graph for main.cpp:

Go to the source code of this file.

Macros

#define IO_REPEAT_DELAY   200
 

Functions

void ICACHE_RAM_ATTR isr ()
 

Variables

volatile int ticks = 0
 
ReactESP app ([]() { Serial.begin(115200);pinMode(LED_PIN, OUTPUT);pinMode(INPUT_PIN, INPUT_PULLUP);app.onRepeatMicros(IO_REPEAT_DELAY, []() { static bool state=false;digitalWrite(LED_PIN, state);state=!state;});app.onInterrupt(INPUT_PIN, RISING, &isr);app.onRepeat(1000, []() { uint64_t now=micros64();uint32_t now_high=now > > 32;uint32_t now_low=now &0xffffffff;Serial.printf("Ticks: %d %08X %08X\n", ticks, now_high, now_low);ticks=0;});pinMode(OUTPUT_PIN, OUTPUT);app.onRepeat(20, []() { digitalWrite(OUTPUT_PIN, !digitalRead(OUTPUT_PIN));});Serial.println("First");Serial.println("Second");})
 

Macro Definition Documentation

◆ IO_REPEAT_DELAY

#define IO_REPEAT_DELAY   200

Definition at line 14 of file main.cpp.

Function Documentation

◆ isr()

void ICACHE_RAM_ATTR isr ( )

Definition at line 18 of file main.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ app

ReactESP app([]() { Serial.begin(115200);pinMode(LED_PIN, OUTPUT);pinMode(INPUT_PIN, INPUT_PULLUP);app.onRepeatMicros(IO_REPEAT_DELAY,[]() { static bool state=false; digitalWrite(LED_PIN, state); state=!state; }); app.onInterrupt(INPUT_PIN, RISING, &isr);app.onRepeat(1000,[]() { uint64_t now=micros64(); uint32_t now_high=now > > 32; uint32_t now_low=now &0xffffffff; Serial.printf("Ticks: %d %08X %08X\n", ticks, now_high, now_low); ticks=0; });pinMode(OUTPUT_PIN, OUTPUT);app.onRepeat(20,[]() { digitalWrite(OUTPUT_PIN, !digitalRead(OUTPUT_PIN)); });Serial.println("First");Serial.println("Second");}) ( [] () { Serial.begin(115200);pinMode(LED_PIN, OUTPUT);pinMode(INPUT_PIN, INPUT_PULLUP);app.onRepeatMicros(IO_REPEAT_DELAY, []() { static bool state=false;digitalWrite(LED_PIN, state);state=!state;});app.onInterrupt(INPUT_PIN, RISING, &isr);app.onRepeat(1000, []() { uint64_t now=micros64();uint32_t now_high=now > > 32;uint32_t now_low=now &0xffffffff;Serial.printf("Ticks: %d %08X %08X\n", ticks, now_high, now_low);ticks=0;});pinMode(OUTPUT_PIN, OUTPUT);app.onRepeat(20, []() { digitalWrite(OUTPUT_PIN, !digitalRead(OUTPUT_PIN));});Serial.println("First");Serial.println("Second");}  )

◆ ticks

volatile int ticks = 0

Definition at line 16 of file main.cpp.