This commit is contained in:
2025-07-05 17:17:50 -04:00
parent 0b86a2bb05
commit a04b090e1b
9 changed files with 84 additions and 3 deletions

View File

@@ -56,6 +56,20 @@ Its intended to be sent from a transmitting device (like a remote control or
<p><em>x_axis</em> and <em>y_axis</em> fields capture analog input from a joystick, determining direction and speed.
<em>nav_bttn</em> represents a joystick push-button.</p>
<p><em>led</em> allows the transmitter to toggle an onboard LED and is used for status indication (e.g. pairing, battery warning, etc).</p>
<p><em>motor1_rpm_pwm</em> to <em>motor4_rpm_pwm</em> provide individual PWM signals to four DC motors.
This enables fine-grained speed control, supports differential drive configurations, and even allows for maneuvering in multi-directional platforms like omni-wheel robots.</p>
</section>
<section id="why-use-attribute-packed">
<h2>Why Use __attribute((packed))?<a class="headerlink" href="#why-use-attribute-packed" title="Link to this heading"></a></h2>
<p>The packed attribute tells the compiler not to add any padding between fields in memory. This makes the struct:</p>
<blockquote>
<div><ul class="simple">
<li><p>Compact</p></li>
<li><p>Predictable for serialization over protocols like UART or ESP-NOW</p></li>
<li><p>Ideal for low-latency transmission in embedded systems</p></li>
</ul>
</div></blockquote>
<p>This ensures the receiver interprets the exact byte layout you expect, minimizing bandwidth and maximizing compatibility across platforms.</p>
</section>
</section>
@@ -90,6 +104,7 @@ Its intended to be sent from a transmitting device (like a remote control or
<li class="toctree-l1"><a class="reference internal" href="overview.html">HOW DOES IT WORK?</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">DATA STRUCT</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#struct-walkthrough">Struct Walkthrough</a></li>
<li class="toctree-l2"><a class="reference internal" href="#why-use-attribute-packed">Why Use __attribute((packed))?</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="transmitter.html">TRANSMITTER</a></li>