diff --git a/GB3TX/GB3TX.ino b/GB3TX/GB3TX.ino index 933f0eb..e9d6d0a 100644 --- a/GB3TX/GB3TX.ino +++ b/GB3TX/GB3TX.ino @@ -1,14 +1,13 @@ #include "config.h" #include "repeater.h" -#define PIP_OUT 13 - void setup() { pinMode(3, OUTPUT); pinMode(8, OUTPUT); pinMode(9, OUTPUT); - pinMode(7, INPUT); + pinMode(7, INPUT_PULLUP); pinMode(6, INPUT_PULLUP); + pinMode(PIP_ATT, OUTPUT); } void loop() { @@ -35,13 +34,15 @@ void loop() { delay(1000); myrpt->transmitter.tx = true; - //sendID(myrpt); + sendID(myrpt); myrpt->state = SLEEP; unsigned long ht = millis(); unsigned long tot = ht; unsigned long kc; unsigned long id = ht; + serial_writer(&myrpt->serial, "READY"); + digitalWrite(PIP_ATT, LOW); while (1) { rx(myrpt); diff --git a/GB3TX/config.h b/GB3TX/config.h index 6f3f873..04859d7 100644 --- a/GB3TX/config.h +++ b/GB3TX/config.h @@ -2,6 +2,7 @@ #define CONFIG_H /* IO */ +#define PIP_ATT 13 #define GW_COS 6 #define COS 7 #define PTT 8 @@ -26,7 +27,7 @@ #define TAILPIP_PITCH 500 /* SERIAL */ -#define SERIAL false +#define SERIAL true #define SERIAL_SPEED 115200 /* TIMERS */ diff --git a/GB3TX/cw.ino b/GB3TX/cw.ino index 7a78d84..bbe697e 100644 --- a/GB3TX/cw.ino +++ b/GB3TX/cw.ino @@ -37,14 +37,27 @@ void sendChar(int speed, int pitch, char c) { } void sendID(repeater* myrpt) { + bool pip_att = false; if (myrpt->callsign == NULL) { return; } for (int i=0; i < sizeof ID/sizeof ID[0]; i++) { + /* attenuate pips in active T/T + * unless first ID from sleep + */ + if (myrpt->state != KEYCHUNK && busy(myrpt) && !pip_att) { + pip_att = true; + digitalWrite(PIP_ATT, HIGH); + } + sendChar(myrpt->params.cw_speed, myrpt->params.cw_pitch, myrpt->callsign[i]); delay(myrpt->params.cw_speed * 3); - } + if (!busy(myrpt) && pip_att) { + pip_att = false; + digitalWrite(PIP_ATT, LOW); + } + } }