|
|
|
@ -268,11 +268,14 @@ void setup() |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
char version_string[LCD_cols + 1]; |
|
|
|
|
generate_version_string(version_string, sizeof(version_string)); |
|
|
|
|
|
|
|
|
|
Serial.println(F("MicroDexed based on https://github.com/asb2m10/dexed")); |
|
|
|
|
Serial.println(F("(c)2018-2020 H. Wirtz <wirtz@parasitstudio.de>")); |
|
|
|
|
Serial.println(F("https://codeberg.org/dcoredump/MicroDexed")); |
|
|
|
|
Serial.print(F("Version: ")); |
|
|
|
|
Serial.println(VERSION); |
|
|
|
|
Serial.println(version_string); |
|
|
|
|
Serial.print(F("CPU-Speed: ")); |
|
|
|
|
Serial.print(F_CPU / 1000000.0, 1); |
|
|
|
|
Serial.println(F(" MHz")); |
|
|
|
@ -329,6 +332,7 @@ void setup() |
|
|
|
|
|
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) |
|
|
|
|
sgtl5000_1.enable(); |
|
|
|
|
sgtl5000_1.lineOutLevel(sgtl5000_level); |
|
|
|
|
sgtl5000_1.dacVolumeRamp(); |
|
|
|
|
sgtl5000_1.dacVolume(1.0); |
|
|
|
|
//sgtl5000_1.dacVolumeRampLinear();
|
|
|
|
@ -337,7 +341,6 @@ void setup() |
|
|
|
|
sgtl5000_1.unmuteLineout(); |
|
|
|
|
sgtl5000_1.autoVolumeDisable(); // turn off AGC
|
|
|
|
|
sgtl5000_1.volume(0.5, 0.5); // Headphone volume
|
|
|
|
|
sgtl5000_1.lineOutLevel(sgtl5000_level); |
|
|
|
|
sgtl5000_1.audioPostProcessorEnable(); |
|
|
|
|
sgtl5000_1.autoVolumeControl(1, 1, 1, 0.9, 0.01, 0.05); |
|
|
|
|
//sgtl5000_1.autoVolumeEnable();
|
|
|
|
@ -1384,7 +1387,7 @@ void initial_values_from_eeprom(bool init) |
|
|
|
|
|
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) |
|
|
|
|
EEPROM.get(EEPROM_SGTL5000_LINEOUT_LEVEL_ADDRESS, sgtl5000_level); |
|
|
|
|
//sgtl5000_1.lineOutLevel(sgtl5000_level);
|
|
|
|
|
sgtl5000_1.lineOutLevel(sgtl5000_level); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
#ifdef DEBUG |
|
|
|
@ -1570,11 +1573,32 @@ uint32_t crc32(byte * calc_start, uint16_t calc_bytes) // base code from https:/ |
|
|
|
|
return (crc); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void generate_version_string(char* buffer, uint8_t len) |
|
|
|
|
{ |
|
|
|
|
char tmp[3]; |
|
|
|
|
strncat(&buffer[0], VERSION, len); |
|
|
|
|
#if defined(TEENSY3_5) |
|
|
|
|
strncat(buffer, "-3.5", 4); |
|
|
|
|
#elif defined(TEENSY3_6) |
|
|
|
|
strncat(buffer, "-3.6", 4); |
|
|
|
|
#elif defined(TEENSY4) |
|
|
|
|
strncat(buffer, "-4.0", 4); |
|
|
|
|
#endif |
|
|
|
|
#if defined(USE_FX) |
|
|
|
|
strncat(buffer, "FX", 2); |
|
|
|
|
#endif |
|
|
|
|
#if defined(MAX_NOTES) |
|
|
|
|
strncat(buffer, "-", 1); |
|
|
|
|
itoa (MAX_NOTES, tmp, 10); |
|
|
|
|
strncat(buffer, tmp, 2); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
|
DEBUG HELPER |
|
|
|
|
******************************************************************************/ |
|
|
|
|
|
|
|
|
|
#if defined (SHOW_CPU_LOAD_MSEC) |
|
|
|
|
#if defined (DEBUG) && defined (SHOW_CPU_LOAD_MSEC) |
|
|
|
|
void show_cpu_and_mem_usage(void) |
|
|
|
|
{ |
|
|
|
|
uint32_t sum_xrun = 0; |
|
|
|
|