kopia lustrzana https://github.com/mobilinkd/tnc3-firmware
Add new EOT indicator.
rodzic
1e1105e8df
commit
9a28e16a61
|
@ -28,6 +28,7 @@ constexpr std::array<uint8_t, 2> LSF_SYNC = { 0x55, 0xF7 };
|
|||
constexpr std::array<uint8_t, 2> STREAM_SYNC = { 0xFF, 0x5D };
|
||||
constexpr std::array<uint8_t, 2> PACKET_SYNC = { 0x75, 0xFF };
|
||||
constexpr std::array<uint8_t, 2> BERT_SYNC = { 0xDF, 0x55 };
|
||||
constexpr std::array<uint8_t, 2> EOT_SYNC = { 0x55, 0x5D };
|
||||
|
||||
inline constexpr uint16_t sync_word(std::array<uint8_t, 2> sw)
|
||||
{
|
||||
|
|
|
@ -378,6 +378,10 @@ void M17Encoder::send_stream(tnc::hdlc::IoFrame* frame, FrameType)
|
|||
frame->clear(); // Re-use existing frame.
|
||||
for (auto c : m17::STREAM_SYNC) frame->push_back(c);
|
||||
for (auto c : m17_frame) frame->push_back(c);
|
||||
if (state == State::IDLE)
|
||||
{
|
||||
for (auto c : m17::EOT_SYNC) frame->push_back(c);
|
||||
}
|
||||
|
||||
auto status = osMessagePut(
|
||||
m17EncoderInputQueueHandle,
|
||||
|
@ -570,7 +574,11 @@ void M17Encoder::encoderTask(void const*)
|
|||
HAL_IWDG_Refresh(&hiwdg);
|
||||
|
||||
auto frame = static_cast<IoFrame*>(evt.value.p);
|
||||
if (frame->size() != 48)
|
||||
if (frame->size() == 50)
|
||||
{
|
||||
INFO("EOT");
|
||||
}
|
||||
else if (frame->size() != 48)
|
||||
{
|
||||
WARN("Bad frame size %u", frame->size());
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue