From f08a5a0c9a103b52a30e8aca0fa2f3cca67268a5 Mon Sep 17 00:00:00 2001 From: Lixie Labs <5051485+connornishijima@users.noreply.github.com> Date: Tue, 7 May 2024 14:38:34 -0600 Subject: [PATCH] Cleaned up global_defines.h --- src/EMOTISCOPE_FIRMWARE.ino | 4 +- src/EMOTISCOPE_FIRMWARE.ino.cpp | 85 --------------------------------- src/global_defines.h | 28 ++++++++--- 3 files changed, 23 insertions(+), 94 deletions(-) delete mode 100644 src/EMOTISCOPE_FIRMWARE.ino.cpp diff --git a/src/EMOTISCOPE_FIRMWARE.ino b/src/EMOTISCOPE_FIRMWARE.ino index b935520..6f01e48 100644 --- a/src/EMOTISCOPE_FIRMWARE.ino +++ b/src/EMOTISCOPE_FIRMWARE.ino @@ -19,7 +19,7 @@ // ## DEPENDENCIES ############################################################ // External dependencies -//#include // .......... You've served me well, but you're not compatible with the 3.0.0-alpha ESP32 board def yet, and I need the IDF 5.1.2 for this madness to even work. I cobbled my own RMT LED driver for now for non-blocking frame transmission. +//#include // .......... You've served me well, but you're not compatible with the 3.0.0-rc1 ESP32 board def yet, and I need the IDF 5.x for this madness to even work. I cobbled my own RMT LED driver for now for non-blocking frame transmission. #include // ........ Handling the web-app HTTP and WS #include // ......... Used to make POST requests to the device discovery server #include // ............ Used for "emotiscope.local" domain name @@ -67,7 +67,7 @@ #include "web_core.h" // Wireless // Development Notes -#include "notes.h" +//#include "notes.h" // ############################################################################ // ## CODE #################################################################### diff --git a/src/EMOTISCOPE_FIRMWARE.ino.cpp b/src/EMOTISCOPE_FIRMWARE.ino.cpp deleted file mode 100644 index fd1d02e..0000000 --- a/src/EMOTISCOPE_FIRMWARE.ino.cpp +++ /dev/null @@ -1,85 +0,0 @@ -# 1 "C:\\Users\\conno\\AppData\\Local\\Temp\\tmpp7lta848" -#include -# 1 "C:/Users/conno/Emotiscope/src/EMOTISCOPE_FIRMWARE.ino" -# 14 "C:/Users/conno/Emotiscope/src/EMOTISCOPE_FIRMWARE.ino" -#define SOFTWARE_VERSION_MAJOR ( 1 ) -#define SOFTWARE_VERSION_MINOR ( 1 ) -#define SOFTWARE_VERSION_PATCH ( 0 ) - - - - - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include "global_defines.h" -#include "hardware_version.h" -#include "types.h" -#include "profiler.h" -#include "sliders.h" -#include "toggles.h" -#include "menu_toggles.h" -#include "menu_dropdowns.h" -#include "filesystem.h" -#include "configuration.h" -#include "utilities.h" -#include "system.h" -#include "led_driver.h" -#include "leds.h" -#include "touch.h" -#include "indicator.h" -#include "ui.h" -#include "microphone.h" -#include "vu.h" -#include "goertzel.h" -#include "tempo.h" -#include "audio_debug.h" -#include "screensaver.h" -#include "standby.h" -#include "lightshow_modes.h" -#include "commands.h" -#include "wireless.h" -#include "ota.h" - - -#include "cpu_core.h" -#include "gpu_core.h" -#include "web_core.h" - - -#include "notes.h" -void loop(); -void loop_gpu(void *param); -void setup(); -#line 76 "C:/Users/conno/Emotiscope/src/EMOTISCOPE_FIRMWARE.ino" -void loop() { - run_cpu(); - run_web(); -} - - -void loop_gpu(void *param) { - for (;;) { - run_gpu(); - } -} - - -void setup() { - - init_system(); - - - (void)xTaskCreatePinnedToCore(loop_gpu, "loop_gpu", 4096, NULL, 0, NULL, 0); -} \ No newline at end of file diff --git a/src/global_defines.h b/src/global_defines.h index 575ef8e..d135a3b 100644 --- a/src/global_defines.h +++ b/src/global_defines.h @@ -1,23 +1,36 @@ // It won't void any kind of stupid warranty, but things will *definitely* break at this point if you change this number. #define NUM_LEDS ( 128 ) -#define NUM_FREQS ( 64 ) // Number of Goertzel instances running in parallel -#define MAX_WEBSOCKET_CLIENTS ( 4 ) // Max simultaneous remote controls allowed at one time +// Number of Goertzel instances running in parallel +#define NUM_FREQS ( 64 ) -#define NOVELTY_HISTORY_LENGTH (1024) // 50 FPS for 20.48 seconds +// Max simultaneous remote controls allowed at one time +#define MAX_WEBSOCKET_CLIENTS ( 4 ) + +// Number of times per second "novelty" is logged #define NOVELTY_LOG_HZ (50) -#define NUM_TEMPI (96) // TEMPO_LOW to TEMPO_HIGH -#define BEAT_SHIFT_PERCENT (0.16) +// 50 FPS for 20.48 seconds +#define NOVELTY_HISTORY_LENGTH (1024) + +// TEMPO_LOW to TEMPO_HIGH +#define NUM_TEMPI (96) -#define TEMPO_LOW (48) // BPM +// BPM range +#define TEMPO_LOW (48) #define TEMPO_HIGH (TEMPO_LOW + NUM_TEMPI) +// How far forward or back in time the beat phase is shifted +#define BEAT_SHIFT_PERCENT (0.16) + +// Set later by physical traces on the PCB uint8_t HARDWARE_VERSION = 0; +// WiFi credentials char wifi_ssid[64] = { 0 }; char wifi_pass[64] = { 0 }; +// WTF ERRORs are used when the program enters a state that should be impossible ------------------- const char* wtf_error_message_header = "^&*@!#^$*WTF?!(%$*&@@^@^$^#&$^ \nWTF ERROR: How the hell did you get here:"; const char* wtf_error_message_tail = "--------------------------------------------------------------------------"; @@ -25,4 +38,5 @@ inline void wtf_error(){ printf("%s\n", wtf_error_message_header); printf("FILE: %s *NEAR* THIS LINE: %d\n", __FILE__, __LINE__ ); // If I inline this function, will this line number roughly match where this function was called from? printf("%s\n", wtf_error_message_tail); -} \ No newline at end of file +} +// -------------------------------------------------------------------------------------------------