From: Benjamin Larsson Date: Wed, 18 May 2016 22:36:25 +0000 (+0200) Subject: Silence warnings X-Git-Tag: sigrok-firmware-fx2lafw-0.1.4~26 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=386296a75ef7c2b3fbbd668de838a16bc13ee461;p=sigrok-firmware-fx2lafw.git Silence warnings The following warnings are fixed by this: hantek_6022be.c:424: warning 158: overflow in implicit constant conversion sainsmart_dds120.c:359: warning 158: overflow in implicit constant conversion sainsmart_dds120.c:363: warning 158: overflow in implicit constant conversion sainsmart_dds120.c:366: warning 158: overflow in implicit constant conversion sainsmart_dds120.c:370: warning 158: overflow in implicit constant conversion sainsmart_dds120.c:494: warning 158: overflow in implicit constant conversion --- diff --git a/hantek_6022be.c b/hantek_6022be.c index a62280d6..e089e969 100644 --- a/hantek_6022be.c +++ b/hantek_6022be.c @@ -421,7 +421,7 @@ static void main(void) /* Init timer2. */ RCAP2L = -500 & 0xff; - RCAP2H = (-500 >> 8) & 0xff; + RCAP2H = (-500 & 0xff00) >> 8; T2CON = 0; ET2 = 1; TR2 = 1; diff --git a/sainsmart_dds120.c b/sainsmart_dds120.c index a854f8d0..9f06af32 100644 --- a/sainsmart_dds120.c +++ b/sainsmart_dds120.c @@ -356,18 +356,18 @@ static BOOL set_calibration_pulse(BYTE fs) switch (fs) { case 0: // 100Hz RCAP2L = -10000 & 0xff; - RCAP2H = (-10000 >> 8) & 0xff; + RCAP2H = (-10000 & 0xff00) >> 8; return TRUE; case 1: // 1kHz RCAP2L = -1000 & 0xff; - RCAP2H = (-1000 >> 8) & 0xff; + RCAP2H = (-1000 & 0xff00) >> 8; return TRUE; case 10: // 1kHz - RCAP2L = -100 & 0xff; + RCAP2L = (BYTE)(-100 & 0xff); RCAP2H = 0xff; return TRUE; case 50: // 50kHz - RCAP2L = -20 & 0xff; + RCAP2L = (BYTE)(-20 & 0xff); RCAP2H = 0xff; return TRUE; default: @@ -491,7 +491,7 @@ static void main(void) /* Init timer2. */ RCAP2L = -1000 & 0xff; - RCAP2H = (-1000 >> 8) & 0xff; + RCAP2H = (-1000 & 0xff00) >> 8; T2CON = 0; ET2 = 1; TR2 = 1;