From cfc4763dd13140558e4a35f58bd0dec538325963 Mon Sep 17 00:00:00 2001 From: Juan Antonio Date: Fri, 8 Dec 2023 15:03:26 +0100 Subject: [PATCH] Scrape together a few bytes --- app/spectrum.c | 4 +--- ui/helper.c | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/spectrum.c b/app/spectrum.c index f8326ce..c8af382 100644 --- a/app/spectrum.c +++ b/app/spectrum.c @@ -1183,9 +1183,7 @@ void APP_RunSpectrum() { RelaunchScan(); - for (int i = 0; i < 128; ++i) { - rssiHistory[i] = 0; - } + memset(rssiHistory, 0, sizeof(rssiHistory)); isInitialized = true; diff --git a/ui/helper.c b/ui/helper.c index 482c70e..5a0ec69 100644 --- a/ui/helper.c +++ b/ui/helper.c @@ -184,10 +184,11 @@ void UI_DisplayFrequency(const char *string, uint8_t X, uint8_t Y, bool center) void UI_DrawPixelBuffer(uint8_t (*buffer)[128], uint8_t x, uint8_t y, bool black) { + const uint8_t pattern = 1 << (y % 8); if(black) - buffer[y/8][x] |= 1 << (y%8); + buffer[y/8][x] |= pattern; else - buffer[y/8][x] &= ~(1 << (y%8)); + buffer[y/8][x] &= ~pattern; } static void sort(int16_t *a, int16_t *b)