AirPlay fix & misc

- Spectrum scale fix
- Initialize more display parameters
- Reboot after 30s of no connection
- Reboot after IP address change
This commit is contained in:
philippe44
2020-03-07 14:01:53 -08:00
parent fae613eb33
commit 8e95bd3dd2
13 changed files with 127 additions and 62 deletions

View File

@@ -100,7 +100,7 @@ static struct {
#define SB_HEIGHT 32
// lenght are number of frames, i.e. 2 channels of 16 bits
#define FFT_LEN_BIT 6
#define FFT_LEN_BIT 7
#define FFT_LEN (1 << FFT_LEN_BIT)
#define RMS_LEN_BIT 6
#define RMS_LEN (1 << RMS_LEN_BIT)
@@ -739,10 +739,10 @@ static void visu_update(void) {
*/
void spectrum_limits(int min, int n, int pos) {
if (n / 2) {
int step = ((DISPLAY_BW - min) * visu.spectrum_scale * 2) / n;
int step = ((DISPLAY_BW - min) * visu.spectrum_scale) / (n/2);
visu.bars[pos].limit = min + step;
for (int i = 1; i < n/2; i++) visu.bars[pos+i].limit = visu.bars[pos+i-1].limit + step;
spectrum_limits(visu.bars[pos + n/2 - 1].limit, n/2, pos + n/2);
spectrum_limits(visu.bars[pos + n/2 - 1].limit, n - n/2, pos + n/2);
} else {
visu.bars[pos].limit = DISPLAY_BW;
}