Applied website user comment bugfixes.
This commit is contained in:
parent
100650edb2
commit
68b0b367e5
2 changed files with 12 additions and 2 deletions
|
@ -23,12 +23,20 @@ void configure_i2s(int rate) {
|
||||||
i2s_adc_enable(I2S_NUM_0);
|
i2s_adc_enable(I2S_NUM_0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void ADC_Sampling(uint16_t *i2s_buff){
|
void ADC_Sampling(uint16_t *i2s_buff){
|
||||||
for (int i = 0; i < B_MULT; i++) {
|
for (int i = 0; i < B_MULT; i++) {
|
||||||
//TODO i2s_read_bytes is deprecated, replace with new function
|
//TODO i2s_read_bytes is deprecated, replace with new function
|
||||||
i2s_read_bytes(I2S_NUM_0, (char*)&i2s_buff[i * NUM_SAMPLES], NUM_SAMPLES * sizeof(uint16_t), portMAX_DELAY);
|
i2s_read_bytes(I2S_NUM_0, (char*)&i2s_buff[i * NUM_SAMPLES], NUM_SAMPLES * sizeof(uint16_t), portMAX_DELAY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
void ADC_Sampling(uint16_t *i2s_buff){
|
||||||
|
size_t bytes_read; for (int i = 0; i < B_MULT; i++) {
|
||||||
|
i2s_read(I2S_NUM_0, (void*)&i2s_buff[i * NUM_SAMPLES], NUM_SAMPLES * sizeof(uint16_t), &bytes_read, portMAX_DELAY);
|
||||||
|
for(size_t ix = 0; ix < bytes_read/2; ix++) i2s_buff[(i * NUM_SAMPLES) + ix] &= 0x0FFF; // 16bit to 12bit conversion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void set_sample_rate(uint32_t rate) {
|
void set_sample_rate(uint32_t rate) {
|
||||||
i2s_driver_uninstall(I2S_NUM_0);
|
i2s_driver_uninstall(I2S_NUM_0);
|
||||||
|
|
|
@ -178,7 +178,8 @@ void draw_sprite(float freq,
|
||||||
spr.drawRect(shift, 0, 70, 30, TFT_WHITE);
|
spr.drawRect(shift, 0, 70, 30, TFT_WHITE);
|
||||||
spr.drawString("P-P: " + String(max_v - min_v) + "V", shift + 5, 5);
|
spr.drawString("P-P: " + String(max_v - min_v) + "V", shift + 5, 5);
|
||||||
spr.drawString(frequency, shift + 5, 15);
|
spr.drawString(frequency, shift + 5, 15);
|
||||||
String offset_line = String((2.0 * v_div) / 1000.0 - offset) + "V";
|
//String offset_line = String((2.0 * v_div) / 1000.0 - offset) + "V";
|
||||||
|
String offset_line = String((3.0 * v_div) / 1000.0 - offset) + "V";
|
||||||
spr.drawString(offset_line, shift + 40, 59);
|
spr.drawString(offset_line, shift + 40, 59);
|
||||||
|
|
||||||
if (set_value) {
|
if (set_value) {
|
||||||
|
@ -200,7 +201,8 @@ void draw_sprite(float freq,
|
||||||
spr.drawString(frequency, shift + 15, 15);
|
spr.drawString(frequency, shift + 15, 15);
|
||||||
spr.drawString(String(int(v_div)) + "mV/div", shift - 100, 5);
|
spr.drawString(String(int(v_div)) + "mV/div", shift - 100, 5);
|
||||||
spr.drawString(String(int(s_div)) + "uS/div", shift - 100, 15);
|
spr.drawString(String(int(s_div)) + "uS/div", shift - 100, 15);
|
||||||
String offset_line = String((2.0 * v_div) / 1000.0 - offset) + "V";
|
//String offset_line = String((2.0 * v_div) / 1000.0 - offset) + "V";
|
||||||
|
String offset_line = String((3.0 * v_div) / 1000.0 - offset) + "V";
|
||||||
spr.drawString(offset_line, shift + 100, 112);
|
spr.drawString(offset_line, shift + 100, 112);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue