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

@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 4ff0b7a7d45b83bb7dd9dbbad6843002
config: b38705e9208fae3c4e0e02be9136bc77
tags: 62a1e7829a13fc7881b6498c52484ec0

View File

@@ -97,6 +97,11 @@
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">
@@ -662,6 +667,52 @@ It&rsquo;s intended to be sent from a transmitting device (like a remote control
</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">
<h3>
Why Use __attribute((packed))?
<a class="headerlink" href="#why-use-attribute-packed" title="Link to this heading">
&para;
</a>
</h3>
<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>
<span id="document-transmitter">