X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hantek_6022bl.c;h=99e43c97218382f104172250f795be03ae059cd4;hb=3968bbfb63b0946841e4f2d78339523a55ef9124;hp=d1ff045eae2f2412f4256c112c501eb2427f343f;hpb=cf43e09a111d7d6bf482521149bd33d85947dede;p=sigrok-firmware-fx2lafw.git diff --git a/hantek_6022bl.c b/hantek_6022bl.c index d1ff045e..99e43c97 100644 --- a/hantek_6022bl.c +++ b/hantek_6022bl.c @@ -66,7 +66,7 @@ void suspend_isr(void) __interrupt SUSPEND_ISR void timer2_isr(void) __interrupt TF2_ISR { - /* Toggle the 1kHz calibration pin, only accurate up to ca 8MHz. */ + /* Toggle the 1kHz calibration pin, only accurate up to ca. 8MHz. */ PC2 = !PC2; if (ledcounter) { @@ -76,6 +76,7 @@ void timer2_isr(void) __interrupt TF2_ISR PC1 = 1; } } + TF2 = 0; } @@ -253,16 +254,18 @@ static BOOL set_samplerate(BYTE rate) /* * The program for low-speed, e.g. 1 MHz, is: - * wait 24, CTL2=0, FIFO - * wait 23, CTL2=1 - * jump 0, CTL2=1 + * wait 24, CTLx=0, FIFO + * wait 23, CTLx=1 + * jump 0, CTLx=1 * * The program for 24 MHz is: - * wait 1, CTL2=0, FIFO - * jump 0, CTL2=1 + * wait 1, CTLx=0, FIFO + * jump 0, CTLx=1 * * The program for 30/48 MHz is: - * jump 0, CTL2=Z, FIFO, LOOP + * jump 0, CTLx=Z, FIFO, LOOP + * + * (CTLx is device-dependent, could be e.g. CTL0 or CTL2.) */ /* LENGTH / BRANCH 0-7 */ @@ -451,7 +454,7 @@ static void main(void) dosuspend = FALSE; do { /* Make sure ext wakeups are cleared. */ - WAKEUPCS |= bmWU|bmWU2; + WAKEUPCS |= bmWU | bmWU2; SUSPEND = 1; PCON |= 1; __asm