Skip to content

Commit 3c543eb

Browse files
authored
Change default RF data rates to 9600 Bd (#463)
Fixes #461
2 parents 622f488 + 37825d6 commit 3c543eb

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Sts1CobcSw/Rf/Rf.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,6 @@ constexpr auto endianness = std::endian::big;
6565
[[maybe_unused]] constexpr auto cmdReadRxFifo = 0x77_b;
6666

6767
// Command answer lengths
68-
//
69-
// TODO: We should do it similarly to SimpleInstruction and SendInstruction() in Flash.cpp. Unless
70-
// this remains the only command with an answer. Then we should probably get rid of SendCommand<>()
71-
// instead.
7268
[[maybe_unused]] constexpr auto partInfoAnswerLength = 8U;
7369
[[maybe_unused]] constexpr auto fifoInfoAnswerLength = 2U;
7470
[[maybe_unused]] constexpr auto interruptStatusAnswerLength = 8U;
@@ -96,8 +92,10 @@ constexpr auto endianness = std::endian::big;
9692
[[maybe_unused]] constexpr auto rssiJumpInterrupt = Byte{1U << 4U};
9793
[[maybe_unused]] constexpr auto invalidSyncInterrupt = Byte{1U << 5U};
9894

95+
// TODO: Use combined RX and TX FIFO to get 128 bytes
9996
[[maybe_unused]] constexpr auto txFifoSize = 64U;
10097
[[maybe_unused]] constexpr auto rxFifoSize = 64U;
98+
// TODO: Choose the right thresholds
10199
constexpr auto txFifoThreshold = 48U; // Free space that triggers TX FIFO almost empty interrupt
102100
constexpr auto rxFifoThreshold = 32U; // Stored bytes trigger RX FIFO almost full interrupt
103101

@@ -118,6 +116,8 @@ constexpr auto postTxDelay = 100 * ms; // Time to wait after sending data to pr
118116
constexpr auto errorHandlingRetryDelay = 1 * ms;
119117
constexpr auto errorHandlingCobcResetDelay = 1 * s;
120118

119+
constexpr auto defaultDataRateConfig = dataRateConfig9600;
120+
121121
auto csGpioPin = hal::GpioPin(hal::rfCsPin);
122122
auto nirqGpioPin = hal::GpioPin(hal::rfNirqPin);
123123
auto sdnGpioPin = hal::GpioPin(hal::rfSdnPin);
@@ -133,10 +133,9 @@ auto rfLatchupDisableGpioPin2 = hal::GpioPin(hal::rfLatchupDisablePin2);
133133
#endif
134134

135135
auto isInTxMode = false;
136-
// TODO: Use 9600 by default
137-
auto rxDataRateConfig = dataRateConfig1200;
138-
auto txDataRateConfig = dataRateConfig1200;
139-
auto currentDataRate = dataRateConfig1200.dataRate;
136+
auto rxDataRateConfig = defaultDataRateConfig;
137+
auto txDataRateConfig = defaultDataRateConfig;
138+
auto currentDataRate = defaultDataRateConfig.dataRate;
140139

141140

142141
using ModemStatus = std::array<Byte, modemStatusAnswerLength>;
@@ -707,7 +706,6 @@ auto PowerUp() -> Result<void>
707706
}
708707

709708

710-
// TODO: values starting with modem* will now be set in SetConstantModemProperties & SetDataRate
711709
// NOLINTNEXTLINE(readability-function-cognitive-complexity)
712710
auto Configure() -> Result<void>
713711
{

0 commit comments

Comments
 (0)