From 374f1907bb70d80fa2f19f3222c9b5e80b51d317 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Sun, 10 Jul 2022 00:47:40 +0300 Subject: [PATCH] fix max|min --- armsrc/hfsnoop.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/armsrc/hfsnoop.c b/armsrc/hfsnoop.c index e06e89eeb..9acbf2d25 100644 --- a/armsrc/hfsnoop.c +++ b/armsrc/hfsnoop.c @@ -46,13 +46,13 @@ static void RAMFUNC skipSniff(uint8_t *dest, uint16_t dsize, uint8_t skipMode, u case HF_SNOOP_SKIP_MAX: if (accum < (val & 0xff)) accum = val & 0xff; - if (accum < (val << 8)) - accum = val << 8; + if (accum < (val >> 8)) + accum = val >> 8; case HF_SNOOP_SKIP_MIN: if (accum > (val & 0xff)) accum = val & 0xff; - if (accum > (val << 8)) - accum = val << 8; + if (accum > (val >> 8)) + accum = val >> 8; case HF_SNOOP_SKIP_AVG: accum += (val & 0xff) + (val >> 8); default: { // HF_SNOOP_SKIP_DROP and the rest @@ -75,7 +75,7 @@ static void RAMFUNC skipSniff(uint8_t *dest, uint16_t dsize, uint8_t skipMode, u } dest++; dsize --; - accum = 0; + accum = (skipMode == HF_SNOOP_SKIP_MIN) ? 0xffffffff : 0; } } }