#include <delay.h>
#include <setupdat.h>
+#define SET_ANALOG_MODE()
+
+/* Toggle the 1kHz calibration pin, only accurate up to ca. 8MHz. */
+#define TOGGLE_CALIBRATION_PIN() PA7 = !PA7
+
/* Change to support as many interfaces as you need. */
static BYTE altiface = 0;
void timer2_isr(void) __interrupt TF2_ISR
{
- /* Toggle the 1kHz calibration pin, only accurate up to ca. 8MHz. */
- PA7 = !PA7;
+ TOGGLE_CALIBRATION_PIN();
if (ledcounter) {
if (--ledcounter == 0) {
{
int i;
+ SET_ANALOG_MODE();
+
clear_fifo();
for (i = 0; i < 1000; i++);
EP4CFG = 0;
EP8CFG = 0;
+ SET_ANALOG_MODE();
+
/* In idle mode tristate all outputs. */
GPIFIDLECTL = 0x00; /* Don't enable CTL0-5 outputs. */
GPIFCTLCFG = 0x80; /* TRICTL=1. CTL0-2: CMOS outputs, tri-statable. */