TinyGPU
Loading...
Searching...
No Matches
Namespaces | Functions
EmulationDesktop.h File Reference

Minimal delay()/millis() for a plain desktop C++ build - no Arduino core, no ESP-IDF. More...

#include <chrono>
#include <thread>
Include dependency graph for EmulationDesktop.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  tinygpu
 

Functions

unsigned long millis ()
 
void delay (unsigned long ms)
 

Detailed Description

Minimal delay()/millis() for a plain desktop C++ build - no Arduino core, no ESP-IDF.

This is the desktop branch of TinyGPU/Emulation.h's fallback - include that instead of this file directly; it decides whether a real Arduino core is available, and routes here only when it isn't and ESP_PLATFORM is also undefined (a plain desktop C++/CMake build that links TinyGPU directly, without the Arduino-Emulator this project's own examples fetch - see the top-level CMakeLists.txt).

millis() is what TinyGPU/Input/GestureDetector.h calls internally to time gesture durations (tap/long-press/swipe/drag), so a desktop consumer of GestureDetector.h needs this fallback to even compile; delay() is provided alongside it for that same consumer's own event loop to pace itself with, the same way every example's loop() does.

Only delay()/millis() are provided here - unlike EmulationIDF.h's ESP-IDF fallback, there's no generic desktop equivalent of a GPIO pin or an SPI/I2C bus to emulate, so pinMode()/digitalWrite()/SPIClass/ TwoWire are intentionally not stubbed out: a file that actually needs one of those (DisplayDriverSPI.h, TouchDriverArduino.h, ...) has no meaningful desktop implementation to fall back to and should fail to compile here rather than silently pretend hardware I/O succeeded.