@@ -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
10199constexpr auto txFifoThreshold = 48U ; // Free space that triggers TX FIFO almost empty interrupt
102100constexpr 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
118116constexpr auto errorHandlingRetryDelay = 1 * ms;
119117constexpr auto errorHandlingCobcResetDelay = 1 * s;
120118
119+ constexpr auto defaultDataRateConfig = dataRateConfig9600;
120+
121121auto csGpioPin = hal::GpioPin(hal::rfCsPin);
122122auto nirqGpioPin = hal::GpioPin(hal::rfNirqPin);
123123auto sdnGpioPin = hal::GpioPin(hal::rfSdnPin);
@@ -133,10 +133,9 @@ auto rfLatchupDisableGpioPin2 = hal::GpioPin(hal::rfLatchupDisablePin2);
133133#endif
134134
135135auto 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
142141using 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)
712710auto Configure () -> Result<void>
713711{
0 commit comments