45 #define SCOPE_MAX_TRIGGER_WAIT 800
48 #define STATE_WAIT_TRIGGER 1
50 #define STATE_PRINTING 3
71 isDualChannel =
false;
72 }
else isDualChannel =
true;
75 while (offset < AUDIO_BLOCK_SAMPLES) {
76 remain = AUDIO_BLOCK_SAMPLES - offset;
78 case STATE_WAIT_TRIGGER:
80 offset = AUDIO_BLOCK_SAMPLES;
87 offset = AUDIO_BLOCK_SAMPLES;
91 state = STATE_PRINTING;
114 for(int16_t i=1;i < AUDIO_BLOCK_SAMPLES-
h_div;i++){
122 if (block->
data[i] > 0 && block->
data[i-1] < 0){
125 if (blockb->
data[i] > 0 || 1){
137 if(!found) {offset = AUDIO_BLOCK_SAMPLES;};
141 while ((offset < AUDIO_BLOCK_SAMPLES) && (
count > 0)){
154 if (isDualChannel && (offset >=
h_div) && blockb->
data[offset] <= 0 && blockb->
data[offset-
h_div] >0){
174 if ((offset >=
h_div) && (blockb->
data[offset] <= -10 ) && (blockb->
data[offset-
h_div] > 10)){
179 if ((offset >=
h_div) && (block->
data[offset] <= -10 ) && (block->
data[offset-
h_div] > 10)){
198 arm_dot_prod_q15(&_memory[0][0],&_memory[1][0],
mem_length,&
dot);
207 memcpy(&memory[1],&_memory[1],
sizeof(_memory[1]));
210 memcpy(&memory[0],&_memory[0],
sizeof(_memory[0]));
228 }
else state = STATE_IDLE;
234 offset = AUDIO_BLOCK_SAMPLES;
239 if(isDualChannel)
release(blockb);
245 return memory[channel][mem_index];
257 state = STATE_PRINTING;
static void release(audio_block_t *block)
audio_block_t * receiveReadOnly(unsigned int index=0)
volatile uint32_t edgeCount_output
volatile int32_t dotMACD_output
volatile int16_t peakValue_output
volatile q63_t dotLast_output
virtual void update(void)
volatile int32_t dotAvgSlow_output
volatile uint32_t edgeDelay_output
volatile int32_t dotAccel_output
int16_t trigger_wait_count
volatile q63_t dot_output
int16_t read(int8_t channel, uint16_t mem_index)
volatile int32_t dotDelta_output
volatile uint32_t edgeDelay2_output
volatile int32_t dotDeltaMACD_output
volatile uint32_t edgeCount_ch2_output
volatile int32_t dotAvg_output
int16_t data[AUDIO_BLOCK_SAMPLES]