Skip to content

Commit

Permalink
Cleaned up global_defines.h
Browse files Browse the repository at this point in the history
  • Loading branch information
connornishijima committed May 7, 2024
1 parent a8b6f78 commit f08a5a0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 94 deletions.
4 changes: 2 additions & 2 deletions src/EMOTISCOPE_FIRMWARE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// ## DEPENDENCIES ############################################################

// External dependencies
//#include <FastLED.h> // .......... 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 <FastLED.h> // .......... 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 <PsychicHttp.h> // ........ Handling the web-app HTTP and WS
#include <HTTPClient.h> // ......... Used to make POST requests to the device discovery server
#include <ESPmDNS.h> // ............ Used for "emotiscope.local" domain name
Expand Down Expand Up @@ -67,7 +67,7 @@
#include "web_core.h" // Wireless

// Development Notes
#include "notes.h"
//#include "notes.h"

// ############################################################################
// ## CODE ####################################################################
Expand Down
85 changes: 0 additions & 85 deletions src/EMOTISCOPE_FIRMWARE.ino.cpp

This file was deleted.

28 changes: 21 additions & 7 deletions src/global_defines.h
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
// 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 = "--------------------------------------------------------------------------";

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);
}
}
// -------------------------------------------------------------------------------------------------

0 comments on commit f08a5a0

Please sign in to comment.