Updated to allow receiving (via serial) a mode command from the Raduino,
and then using that to set rigMode. Note that it doesn't actually do anything beyond that, at the moment, but I *think* this will allow PTT events to be pressed in CW mode (as CW key down).
This commit is contained in:
parent
211d9ff9b4
commit
f35653987f
13
audio.ino
13
audio.ino
@ -76,6 +76,8 @@ void audioInit()
|
|||||||
//audioCtrl.dacVolume(1.0, 0.0); // we're going to mute TX audio via the DAC unless we're transmitting
|
//audioCtrl.dacVolume(1.0, 0.0); // we're going to mute TX audio via the DAC unless we're transmitting
|
||||||
|
|
||||||
audioSelectTxInput(TX_MIC_IN); // superfluous I think
|
audioSelectTxInput(TX_MIC_IN); // superfluous I think
|
||||||
|
|
||||||
|
audioCWFilterNarrow(); // test
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void updateRxRigIn()
|
inline void updateRxRigIn()
|
||||||
@ -538,6 +540,17 @@ void audioCalibrate(IOPConfig* c, char cmd, char subcmd, char parm, float value,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int updateFilter[5];
|
||||||
|
|
||||||
|
void audioCWFilterNarrow()
|
||||||
|
{
|
||||||
|
audioCtrl.audioPreProcessorEnable();
|
||||||
|
// calcBiquad(FilterType,FrequencyC,dBgain,Q,QuantizationUnit,SampleRate,int*);
|
||||||
|
calcBiquad(FILTER_BANDPASS, 700, 0, 2, 524288, 44100, updateFilter);
|
||||||
|
audioCtrl.eqFilter(0, updateFilter);
|
||||||
|
audioCtrl.eqFilter(1, updateFilter);
|
||||||
|
}
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
// EOF
|
// EOF
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
16
cat.ino
16
cat.ino
@ -10,6 +10,11 @@
|
|||||||
#define EEPROM_READ_PREFIX 0xE0
|
#define EEPROM_READ_PREFIX 0xE0
|
||||||
#define EEPROM_WRITE_PREFIX 0xF0
|
#define EEPROM_WRITE_PREFIX 0xF0
|
||||||
|
|
||||||
|
#define IOP_MODE_COMMAND 0x00
|
||||||
|
#define IOP_MODE_SSB 0x01
|
||||||
|
#define IOP_MODE_DIGI 0x02
|
||||||
|
#define IOP_MODE_CW 0x03
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
// CAT from PC-to-IOP
|
// CAT from PC-to-IOP
|
||||||
//
|
//
|
||||||
@ -44,6 +49,17 @@ void initCAT(long baud, int portConfig)
|
|||||||
|
|
||||||
void processIOPCommand(const byte* buf, int len)
|
void processIOPCommand(const byte* buf, int len)
|
||||||
{
|
{
|
||||||
|
if (len > 0) {
|
||||||
|
switch(buf[0]) {
|
||||||
|
case IOP_MODE_COMMAND:
|
||||||
|
if (len < 2) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
rigMode = RigMode(buf[1]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
2
config.h
2
config.h
@ -8,7 +8,7 @@
|
|||||||
// Uncomment to use the "factory" calibration mode. This is intended to
|
// Uncomment to use the "factory" calibration mode. This is intended to
|
||||||
// allow calibration of IOP settings, separately from the uBITX/Raduino.
|
// allow calibration of IOP settings, separately from the uBITX/Raduino.
|
||||||
// There will be no pass-thru of any CAT.
|
// There will be no pass-thru of any CAT.
|
||||||
#define FACTORY_CALIBRATION
|
//#define FACTORY_CALIBRATION
|
||||||
|
|
||||||
// IOPConfig
|
// IOPConfig
|
||||||
// Used to store configuration parameters during runtime, as well as to
|
// Used to store configuration parameters during runtime, as well as to
|
||||||
|
@ -87,6 +87,25 @@ void setup() {
|
|||||||
audioInit();
|
audioInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//======================================================================
|
||||||
|
|
||||||
|
void setRigMode(RigMode m)
|
||||||
|
{
|
||||||
|
rigMode = m;
|
||||||
|
switch(rigMode) {
|
||||||
|
case MODE_SSB:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_DIGI:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_CW:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//======================================================================
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
elapsedMillis frame_timer = 0;
|
elapsedMillis frame_timer = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user