X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=fx2lafw.c;h=1035713da4f560736af1dd4e6ab1c6a3eac8d746;hb=f3e9593b3d205ae4699dacc6a201f01f755757ef;hp=d601e277a6983bcbbc609dae6c86d88ebb68afc9;hpb=f6ef2ff72979fd6504b930d7db9506f35ce07d37;p=sigrok-firmware-fx2lafw.git diff --git a/fx2lafw.c b/fx2lafw.c index d601e277..1035713d 100644 --- a/fx2lafw.c +++ b/fx2lafw.c @@ -215,7 +215,7 @@ void ibn_isr(void) __interrupt IBN_ISR */ if ((IBNIRQ & bmEP2IBN) && (gpif_acquiring == PREPARED)) { ledcounter = 1; - PA1 = 0; + LED_OFF(); gpif_acquisition_start(); } @@ -246,11 +246,11 @@ void timer2_isr(void) __interrupt TF2_ISR /* Blink LED during acquisition, keep it on otherwise. */ if (gpif_acquiring == RUNNING) { if (--ledcounter == 0) { - PA1 = !PA1; + LED_TOGGLE(); ledcounter = 1000; } } else if (gpif_acquiring == STOPPED) { - PA1 = 1; /* LED on. */ + LED_ON(); } TF2 = 0; } @@ -276,10 +276,8 @@ void fx2lafw_init(void) ENABLE_HISPEED(); ENABLE_USBRESET(); - /* PA1 (LED) is an output. */ - PORTACFG = 0; - OEA = (1 << 1); - PA1 = 1; /* LED on. */ + LED_INIT(); + LED_ON(); /* Init timer2. */ RCAP2L = -500 & 0xff;