X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=sainsmart_dds120.c;h=2c3b73c67f2757496e3ca5415ce0fecdd9614261;hb=1d203181ea88f0b609142adae4b650f950b857dd;hp=a854f8d01ec80c0c6f1d22b05ebeffa02d4adb41;hpb=24373950c5858ea7761ac8aa77b51c717558316b;p=sigrok-firmware-fx2lafw.git diff --git a/sainsmart_dds120.c b/sainsmart_dds120.c index a854f8d0..2c3b73c6 100644 --- a/sainsmart_dds120.c +++ b/sainsmart_dds120.c @@ -15,8 +15,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * License along with this library; if not, see . */ #include @@ -356,18 +355,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 +490,7 @@ static void main(void) /* Init timer2. */ RCAP2L = -1000 & 0xff; - RCAP2H = (-1000 >> 8) & 0xff; + RCAP2H = (-1000 & 0xff00) >> 8; T2CON = 0; ET2 = 1; TR2 = 1;