add panic if recbuf is not allocated

should never happen, but, might as well dot the i's.
This commit is contained in:
bunnie 2023-01-02 14:49:32 +08:00
parent 7c231f0955
commit 6266d8a74d

View file

@ -405,6 +405,8 @@ impl<'a> ShellCmdApi<'a> for Test {
right_samples.push( ((sample & 0xFFFF) as i16) as f32 );
//left_samples.push( (((sample >> 16) & 0xFFFF) as i16) as f32 ); // reminder of how to extract the right channel
}
} else {
panic!("recbuf was not allocated");
}
// only one channel is considered, because in reality the left is just a copy of the right, as
// we are taking a mono microphone signal and mixing it into both ADCs