]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blobdiff - sainsmart_dds120.c
Add "fx2lafw-" prefix to the 6022BE/DDS120 firmware files.
[sigrok-firmware-fx2lafw.git] / sainsmart_dds120.c
index a854f8d01ec80c0c6f1d22b05ebeffa02d4adb41..9f06af32ae318bf0bd13915951563b7fe7e88f47 100644 (file)
@@ -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;