+static int16_t
+tncFill(uint8_t *buf, int16_t len)
+{
+ int16_t l = 0;
+ uint8_t b;
+ uint8_t bit;
+
+ while (tncMode != TNC_TX_READY && l < len) {
+ b = 0;
+ for (bit = 0; bit < 8; bit++) {
+ b = b << 1 | (timeNCO >> 15);
+ timeNCO += timeNCOFreq;
+ }
+ *buf++ = b;
+ l++;
+ tnc1200TimerTick();
+ }
+ if (tncMode == TNC_TX_READY)
+ l = -l;
+ return l;
+}
+