X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hantek_6022bl.c;h=4920047cdfed7ccf0a4e294465fd6c1683b5f71e;hb=e583c3fcd0bd1e4a44846fba5e80bbea1ff215a2;hp=99e43c97218382f104172250f795be03ae059cd4;hpb=3968bbfb63b0946841e4f2d78339523a55ef9124;p=sigrok-firmware-fx2lafw.git diff --git a/hantek_6022bl.c b/hantek_6022bl.c index 99e43c97..4920047c 100644 --- a/hantek_6022bl.c +++ b/hantek_6022bl.c @@ -24,6 +24,11 @@ #include #include +#define SET_ANALOG_MODE() PA7 = 1 + +/* Toggle the 1kHz calibration pin, only accurate up to ca. 8MHz. */ +#define TOGGLE_CALIBRATION_PIN() PC2 = !PC2 + /* Change to support as many interfaces as you need. */ static BYTE altiface = 0; @@ -66,8 +71,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. */ - PC2 = !PC2; + TOGGLE_CALIBRATION_PIN(); if (ledcounter) { if (--ledcounter == 0) { @@ -165,8 +169,7 @@ static void start_sampling(void) { int i; - /* Set analog mode. */ - PA7 = 1; + SET_ANALOG_MODE(); clear_fifo(); @@ -393,8 +396,7 @@ static void init(void) EP4CFG = 0; EP8CFG = 0; - /* Set analog mode. */ - PA7 = 1; + SET_ANALOG_MODE(); /* In idle mode tristate all outputs. */ GPIFIDLECTL = 0x00; /* Don't enable CTL0-5 outputs. */