 
 enum Mode VfoMode;          // VFO mode
 
-typedef unsigned long Frequency;
+typedef ULONG Frequency;
 Frequency VfoFrequency;     // VFO frequency (Hz)
 
 typedef int SelOffset;

    return;
    
  // as in datasheet page 12 - modified to include calibration offset
  unsigned long data = (frequency * 4294967296) / (180000000 - VfoClockOffset);

  Serial.printf(F("dds_update: frequency=%ld, VfoClockOffset=%d, data=%ld\n"),
                frequency, VfoClockOffset, data);

const int DefaultDClickTime = 300;    // default time

// internal variables
UINT ReHoldClickTime = DefaultHoldClickTime;
UINT ReDClickTime = DefaultDClickTime;

bool re_rotation = false;     // true if rotation occurred while knob down
bool re_down = false;         // true while knob is down
ULONG re_down_time = 0;       // milliseconds when knob is pressed down
ULONG last_click = 0;         // time when last single click was found

// expecting rising edge on pinA - at detent
volatile byte aFlag = 0;
