Updated with some of the changes I made on travel. Will probably break everything...

This commit is contained in:
Rob French
2021-03-03 10:44:25 -06:00
parent 119902b1e0
commit 86ae1ddb2f
11 changed files with 501 additions and 98 deletions

View File

@@ -56,7 +56,7 @@ void UBitxRigState::begin() {
#include "ubitx.h"
#include "ubitx_eemap.h"
extern unsigned long frequency, ritRxFrequency, ritTxFrequency;
extern unsigned long frequency, ritRxFrequency, ritTxFrequency, sideTone;
extern unsigned long vfoA;
extern unsigned long vfoB;
extern char cwMode;
@@ -169,8 +169,10 @@ void UBitxRigState::writeDirty() {
// XIT - TODO
}
// VFO A/B selection
// Various flags
if (isDirty(FLAGS_WORD)) {
// VFO A/B selection
char prev = vfoActive;
vfoActive = isVFOA() ? VFO_A : VFO_B;
if (vfoActive != prev) {
@@ -214,6 +216,13 @@ void UBitxRigState::writeDirty() {
setFrequency(frequency);
}
}
// Keyer information
if (isDirty(KEYER_WORD)) {
// Sidetone frequency
sideTone = static_cast<unsigned long>(getSidetone());
}
}
/*!
@@ -284,17 +293,22 @@ void UBitxRigState::readDirty() {
char curr = (cwMode << 1) | isUSB;
if (curr != prev) {
if (cwMode == 2) {
setCW();
setModeCW();
} else if (cwMode == 1) {
setCWR();
setModeCWR();
} else {
if (isUSB) {
setUSB();
setModeUSB();
} else {
setLSB();
setModeLSB();
}
}
}
// Sidetone
if (getSidetone() != static_cast<uint16_t>(sideTone)) {
setSidetone(static_cast<uint16_t>(sideTone));
}
}
/***********************************************************************
@@ -332,6 +346,16 @@ void UBitxRigState::receive_RIGINF(int numBytes) {
}
}
//--------------------------------------------------------------------
// Do anything that needs to happen when something is updated by the
// Raduino... this would be due to e.g. changes through the menu.
// Current (as of 2/19/2021) things that DON'T need to have any
// updates: frequency (those just get requested by CAT as needed).
// Current things that do need to get updated: sidetone (used to
// update CW filter values).
//--------------------------------------------------------------------
processDirty();
IFDEBUG( serialHexState("Rcvd") );
IFDEBUG( serialPrettyState("Rcvd") );
}
@@ -372,6 +396,13 @@ void UBitxRigState::send_RIGINF() {
//--------------------------------------------------------------------
}
/*!
* @brief Perform required actions based on any dirty bits set.
*/
void UBitxRigState::processDirty() {
}
#endif
#ifdef DEBUG