From 80d6b40a7d512c91ded04df63ad7ce34f7cdb797 Mon Sep 17 00:00:00 2001 From: bbkiwi Date: Wed, 24 Apr 2019 22:07:28 +1200 Subject: [PATCH] A squashed, should only change a few lines and no mucking about with submodules --- embedded8266/ccconfig.h | 4 ++-- embedded8266/user/ws2812_i2s.c | 3 +-- embeddedcommon/DFT32.c | 1 + embeddedcommon/embeddedout.c | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/embedded8266/ccconfig.h b/embedded8266/ccconfig.h index b32d2a6..dc549a7 100644 --- a/embedded8266/ccconfig.h +++ b/embedded8266/ccconfig.h @@ -6,9 +6,9 @@ #define HPABUFFSIZE 512 #define CCEMBEDDED -#define NUM_LIN_LEDS 541 +#define NUM_LIN_LEDS 16 #define DFREQ 16000 - +#define LUXETRON 0 #define memcpy ets_memcpy #define memset ets_memset diff --git a/embedded8266/user/ws2812_i2s.c b/embedded8266/user/ws2812_i2s.c index fb41186..ea9963d 100644 --- a/embedded8266/user/ws2812_i2s.c +++ b/embedded8266/user/ws2812_i2s.c @@ -45,9 +45,8 @@ Extra copyright info: //Creates an I2S SR of 93,750 Hz, or 3 MHz Bitclock (.333us/sample) // 12000000L/(div*bestbck*2) //It is likely you could speed this up a little. -#define LUXETRON -#ifdef LUXETRON +#if LUXETRON == 1 #define INVERT #define WS_I2S_BCK 14 #define WS_I2S_DIV 5 diff --git a/embeddedcommon/DFT32.c b/embeddedcommon/DFT32.c index 1741e41..e4f8c53 100644 --- a/embeddedcommon/DFT32.c +++ b/embeddedcommon/DFT32.c @@ -192,6 +192,7 @@ void UpdateOutputBins32() isps = isps<0? -isps : isps; ispc = ispc<0? -ispc : ispc; uint32_t rmux = isps>ispc? isps + (ispc>>1) : ispc + (isps>>1); + rmux = rmux>>16; #else uint32_t rmux = ( (isps) * (isps)) + ((ispc) * (ispc)); rmux = SquareRootRounded( rmux ); diff --git a/embeddedcommon/embeddedout.c b/embeddedcommon/embeddedout.c index 12a3cf1..0a60dee 100644 --- a/embeddedcommon/embeddedout.c +++ b/embeddedcommon/embeddedout.c @@ -61,17 +61,17 @@ void UpdateLinearLEDs() { if( note_peak_freqs[ sorted_note_map[j] ] > nff ) { - break; + break; // so j is correct place to insert } } - for( k = sorted_map_count; k > j; k-- ) + for( k = sorted_map_count; k > j; k-- ) // make room { sorted_note_map[k] = sorted_note_map[k-1]; } - sorted_note_map[j] = i; + sorted_note_map[j] = i; // insert in correct place #else + sorted_note_map[sorted_map_count] = i; // insert at end #endif - sorted_note_map[sorted_map_count] = i; sorted_map_count++; }