diff --git a/App/app/spectrum.c b/App/app/spectrum.c index 0787ce65..30983198 100644 --- a/App/app/spectrum.c +++ b/App/app/spectrum.c @@ -954,16 +954,16 @@ uint8_t Rssi2Y(uint16_t rssi) // Total width units = (bars - 1) full bars + 2 half bars = bars // First bar: half width, middle bars: full width, last bar: half width // Scale: 128 pixels / (bars - 1) = pixels per full bar - uint16_t fullWidth = 128 * 2 / (bars - 1); // x2 for precision + uint16_t fullWidth = (128 << 8) / (bars - 1); // x256 for precision if (i == 0) { - x = fullWidth / 4; // half of half (because fullWidth is x2) + x = fullWidth / (2 << 8); // half of /256 (because fullWidth is x256) } else { // Position = half + (i-1) full bars + current bar - x = fullWidth / 4 + (uint16_t)i * fullWidth / 2; + x = fullWidth / (2 << 8) + (uint16_t)i * fullWidth / (1 << 8); if (i == bars - 1) x = 128; // Last bar ends at screen edge } }