Skip to content

Commit

Permalink
Merge pull request #407 from 4ms/fix-noisepleth-progsel
Browse files Browse the repository at this point in the history
Fix Noise Plethora changing program selection
  • Loading branch information
danngreen authored Oct 10, 2024
2 parents 6dc5253 + ee4f657 commit fc4e5e0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
url = https://github.com/4ms/AudibleInstruments.git
[submodule "firmware/vcv_ports/Befaco"]
path = firmware/vcv_ports/Befaco
url = https://github.com/hemmer/Befaco.git
url = https://github.com/danngreen/Befaco.git
[submodule "firmware/vcv_ports/hetrickcv"]
path = firmware/vcv_ports/hetrickcv
url = https://github.com/mhetrick/hetrickcv.git
Expand Down
2 changes: 2 additions & 0 deletions firmware/src/medium/debug_raw.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ static inline void DebugPin0Low() {
volatile uint32_t *GPIOB_BSRR = (volatile uint32_t *)(0x50003018);
*GPIOB_BSRR = (1 << (10 + 16));
}

#define HARDWARE_BKPT() asm volatile("bkpt")
30 changes: 29 additions & 1 deletion firmware/vcv_plugin/export/src/logger.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "logger.hpp"
#include "console/pr_dbg.hh"
#include <ctime>

namespace rack::logger
{
Expand All @@ -11,8 +13,34 @@ void init() {
void destroy() {
}

#ifndef LOG_LEVEL
#define LOG_LEVEL 0
#endif

static const char* const levelLabels[] = {
"debug",
"info",
"warn",
"fatal",
};

void log(Level level, const char *filename, int line, const char *func, const char *format, ...) {
//

if (level == Level::DEBUG_LEVEL && LOG_LEVEL <= 3)
return;
else if (level == Level::INFO_LEVEL && LOG_LEVEL <= 2)
return;
else if (level == Level::WARN_LEVEL && LOG_LEVEL <= 1)
return;
else if (level == Level::FATAL_LEVEL && LOG_LEVEL <= 0)
return;

va_list args;
va_start(args, format);
printf("[%lld %s %s:%d %s] ", std::time(nullptr), levelLabels[level], filename, line, func);
vprintf(format, args);
printf("\n");
va_end(args);
}

bool wasTruncated() {
Expand Down

0 comments on commit fc4e5e0

Please sign in to comment.