MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / tmate2WriteMainDisplay

Function tmate2WriteMainDisplay

src/core/HidEncoderManager.cpp:299–312  ·  view source on GitHub ↗

Write frequency (Hz) to bytes 3..20 of the LCDVector. Only the seven A-G segment bits per digit are touched; indicator bits that share those bytes (underlines, DRV, NR2, …) are preserved.

Source from the content-addressed store, hash-verified

297// Only the seven A-G segment bits per digit are touched; indicator bits that
298// share those bytes (underlines, DRV, NR2, …) are preserved.
299static void tmate2WriteMainDisplay(uint8_t* v, uint32_t hz)
300{
301 if (hz > 999999999u) hz = 999999999u;
302 for (int d = 1; d <= 9; ++d) {
303 uint8_t hi = static_cast<uint8_t>(22 - 2 * d);
304 uint8_t lo = static_cast<uint8_t>(21 - 2 * d);
305 v[hi] &= 0xF8u;
306 v[lo] &= 0xF0u;
307 if (hz == 0u && d > 1) continue;
308 v[hi] |= kMainHigh[hz % 10u];
309 v[lo] |= kMainLow [hz % 10u];
310 hz /= 10u;
311 }
312}
313
314static void tmate2WriteMainDisplayText(uint8_t* v, const QString& text)
315{

Callers 2

setTMate2DisplayMethod · 0.85
setTMate2DisplayTextMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected