arduino-audio-tools
All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Modules Pages
AudioRuntime.h
1#pragma once
2
3#include "AudioToolsConfig.h"
4
5namespace audio_tools {
6
14inline void stop() {
15 #ifdef EXIT_ON_STOP
16 exit(0);
17 #else
18 while(true){
19 delay(1000);
20 }
21 #endif
22}
23
25inline static void checkMemory(bool printMemory=false) {
26 #if defined(ESP32) && defined(ARDUINO)
27 assert(heap_caps_check_integrity_all(true));
28 if (printMemory) Serial.printf("==> Available stack: %d - heap: %u - psram: %u\n",(int) uxTaskGetStackHighWaterMark(NULL), (unsigned)ESP.getFreeHeap(),(unsigned)ESP.getFreePsram());
29 #endif
30}
31
32#ifdef ARDUINO
33inline void printNChar(char ch, int n){
34 for (int j=0;j<n;j++) Serial.print(ch);
35 Serial.println();
36}
37
38#ifndef ESP_ARDUINO_VERSION_STR
39# define df2xstr(s) #s
40# define df2str(s) df2xstr(s)
41# define ESP_ARDUINO_VERSION_STR df2str(ESP_ARDUINO_VERSION_MAJOR) "." df2str(ESP_ARDUINO_VERSION_MINOR) "." df2str(ESP_ARDUINO_VERSION_PATCH)
42#endif
43
45inline void printVersionInfo() {
46 printNChar('*',50);
47 Serial.print("AudioTools: ");
48 Serial.println(AUDIOTOOLS_VERSION);
49 Serial.print("Arduino: ");
50 Serial.println(ARDUINO);
51#ifdef ESP32
52 Serial.print("Arduino ESP Core Version: ");
53 Serial.println(ESP_ARDUINO_VERSION_STR);
54 Serial.print("IDF Version: ");
55 Serial.println(IDF_VER);
56#endif
57 printNChar('*',50);
58}
59
60#endif
61
62}
void stop()
Public generic methods.
Definition AudioRuntime.h:14
static void checkMemory(bool printMemory=false)
Executes heap_caps_check_integrity_all()
Definition AudioRuntime.h:25
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition AudioCodecsBase.h:10