mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-08 09:50:52 +00:00
.
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -25,7 +25,7 @@ When used with communication protocols like ESP-NOW, this struct is **encoded**
|
|||||||
**decoded** on the receiving end to control hardware.
|
**decoded** on the receiving end to control hardware.
|
||||||
|
|
||||||
Struct Walkthrough
|
Struct Walkthrough
|
||||||
^^^^^^^^^^^^^^^^^^
|
------------------
|
||||||
|
|
||||||
*x_axis* and *y_axis* fields capture analog input from a joystick, determining direction and speed.
|
*x_axis* and *y_axis* fields capture analog input from a joystick, determining direction and speed.
|
||||||
*nav_bttn* represents a joystick push-button.
|
*nav_bttn* represents a joystick push-button.
|
||||||
@@ -36,7 +36,7 @@ Struct Walkthrough
|
|||||||
This enables fine-grained speed control, supports differential drive configurations, and even allows for maneuvering in multi-directional platforms like omni-wheel robots.
|
This enables fine-grained speed control, supports differential drive configurations, and even allows for maneuvering in multi-directional platforms like omni-wheel robots.
|
||||||
|
|
||||||
Why Use __attribute((packed))?
|
Why Use __attribute((packed))?
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
ESP-NOW uses fixed-size data packets (up to 250 bytes). The *__attribute__((packed))* removes compiler-added padding for precise byte alignment.
|
ESP-NOW uses fixed-size data packets (up to 250 bytes). The *__attribute__((packed))* removes compiler-added padding for precise byte alignment.
|
||||||
|
|
||||||
|
@@ -61,9 +61,8 @@ It’s intended to be sent from a transmitting device (like a remote control or
|
|||||||
<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>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.
|
<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>
|
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">
|
<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>
|
<h3>Why Use __attribute((packed))?<a class="headerlink" href="#why-use-attribute-packed" title="Link to this heading">¶</a></h3>
|
||||||
<p>ESP-NOW uses fixed-size data packets (up to 250 bytes). The <em>__attribute__((packed))</em> removes compiler-added padding for precise byte alignment.</p>
|
<p>ESP-NOW uses fixed-size data packets (up to 250 bytes). The <em>__attribute__((packed))</em> removes compiler-added padding for precise byte alignment.</p>
|
||||||
<p>As <em>packed</em> attribute tells the compiler not to add any padding between fields in memory, this makes the struct:</p>
|
<p>As <em>packed</em> attribute tells the compiler not to add any padding between fields in memory, this makes the struct:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
@@ -75,6 +74,7 @@ This enables fine-grained speed control, supports differential drive configurati
|
|||||||
</div></blockquote>
|
</div></blockquote>
|
||||||
<p>This ensures the receiver interprets the exact byte layout you expect, minimizing bandwidth and maximizing compatibility across platforms.</p>
|
<p>This ensures the receiver interprets the exact byte layout you expect, minimizing bandwidth and maximizing compatibility across platforms.</p>
|
||||||
</section>
|
</section>
|
||||||
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
@@ -108,7 +108,6 @@ This enables fine-grained speed control, supports differential drive configurati
|
|||||||
<li class="toctree-l1"><a class="reference internal" href="overview.html">HOW DOES IT WORK?</a></li>
|
<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-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="#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>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="transmitter.html">TRANSMITTER</a></li>
|
<li class="toctree-l1"><a class="reference internal" href="transmitter.html">TRANSMITTER</a></li>
|
||||||
|
@@ -46,7 +46,6 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="data.html">DATA STRUCT</a><ul>
|
<li class="toctree-l1"><a class="reference internal" href="data.html">DATA STRUCT</a><ul>
|
||||||
<li class="toctree-l2"><a class="reference internal" href="data.html#struct-walkthrough">Struct Walkthrough</a></li>
|
<li class="toctree-l2"><a class="reference internal" href="data.html#struct-walkthrough">Struct Walkthrough</a></li>
|
||||||
<li class="toctree-l2"><a class="reference internal" href="data.html#why-use-attribute-packed">Why Use __attribute((packed))?</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="toctree-l1"><a class="reference internal" href="transmitter.html">TRANSMITTER</a><ul>
|
<li class="toctree-l1"><a class="reference internal" href="transmitter.html">TRANSMITTER</a><ul>
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
|||||||
# Sphinx build info version 1
|
# 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.
|
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||||
config: 73c850fc9da2302c95bfd56436e2cb64
|
config: c7af3d195780d92aa8671f9064b2c06a
|
||||||
tags: 62a1e7829a13fc7881b6498c52484ec0
|
tags: 62a1e7829a13fc7881b6498c52484ec0
|
||||||
|
Binary file not shown.
@@ -97,11 +97,6 @@
|
|||||||
Struct Walkthrough
|
Struct Walkthrough
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="toctree-l2">
|
|
||||||
<a class="reference internal" href="#why-use-attribute-packed">
|
|
||||||
Why Use __attribute((packed))?
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="toctree-l1">
|
<li class="toctree-l1">
|
||||||
@@ -693,52 +688,52 @@ It’s intended to be sent from a transmitting device (like a remote control
|
|||||||
provide individual PWM signals to four DC motors.
|
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.
|
This enables fine-grained speed control, supports differential drive configurations, and even allows for maneuvering in multi-directional platforms like omni-wheel robots.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
<section id="why-use-attribute-packed">
|
||||||
<section id="why-use-attribute-packed">
|
<h4>
|
||||||
<h3>
|
Why Use __attribute((packed))?
|
||||||
Why Use __attribute((packed))?
|
<a class="headerlink" href="#why-use-attribute-packed" title="Link to this heading">
|
||||||
<a class="headerlink" href="#why-use-attribute-packed" title="Link to this heading">
|
¶
|
||||||
¶
|
</a>
|
||||||
</a>
|
</h4>
|
||||||
</h3>
|
<p>
|
||||||
<p>
|
ESP-NOW uses fixed-size data packets (up to 250 bytes). The
|
||||||
ESP-NOW uses fixed-size data packets (up to 250 bytes). The
|
<em>
|
||||||
<em>
|
__attribute__((packed))
|
||||||
__attribute__((packed))
|
</em>
|
||||||
</em>
|
removes compiler-added padding for precise byte alignment.
|
||||||
removes compiler-added padding for precise byte alignment.
|
</p>
|
||||||
</p>
|
<p>
|
||||||
<p>
|
As
|
||||||
As
|
<em>
|
||||||
<em>
|
packed
|
||||||
packed
|
</em>
|
||||||
</em>
|
attribute tells the compiler not to add any padding between fields in memory, this makes the struct:
|
||||||
attribute tells the compiler not to add any padding between fields in memory, this makes the struct:
|
</p>
|
||||||
</p>
|
<blockquote>
|
||||||
<blockquote>
|
<div>
|
||||||
<div>
|
<ul class="simple">
|
||||||
<ul class="simple">
|
<li>
|
||||||
<li>
|
<p>
|
||||||
<p>
|
Compact
|
||||||
Compact
|
</p>
|
||||||
</p>
|
</li>
|
||||||
</li>
|
<li>
|
||||||
<li>
|
<p>
|
||||||
<p>
|
Predictable for serialization over protocols like UART or ESP-NOW
|
||||||
Predictable for serialization over protocols like UART or ESP-NOW
|
</p>
|
||||||
</p>
|
</li>
|
||||||
</li>
|
<li>
|
||||||
<li>
|
<p>
|
||||||
<p>
|
Ideal for low-latency transmission in embedded systems
|
||||||
Ideal for low-latency transmission in embedded systems
|
</p>
|
||||||
</p>
|
</li>
|
||||||
</li>
|
</ul>
|
||||||
</ul>
|
</div>
|
||||||
</div>
|
</blockquote>
|
||||||
</blockquote>
|
<p>
|
||||||
<p>
|
This ensures the receiver interprets the exact byte layout you expect, minimizing bandwidth and maximizing compatibility across platforms.
|
||||||
This ensures the receiver interprets the exact byte layout you expect, minimizing bandwidth and maximizing compatibility across platforms.
|
</p>
|
||||||
</p>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<span id="document-transmitter">
|
<span id="document-transmitter">
|
||||||
|
@@ -25,7 +25,7 @@ When used with communication protocols like ESP-NOW, this struct is **encoded**
|
|||||||
**decoded** on the receiving end to control hardware.
|
**decoded** on the receiving end to control hardware.
|
||||||
|
|
||||||
Struct Walkthrough
|
Struct Walkthrough
|
||||||
^^^^^^^^^^^^^^^^^^
|
------------------
|
||||||
|
|
||||||
*x_axis* and *y_axis* fields capture analog input from a joystick, determining direction and speed.
|
*x_axis* and *y_axis* fields capture analog input from a joystick, determining direction and speed.
|
||||||
*nav_bttn* represents a joystick push-button.
|
*nav_bttn* represents a joystick push-button.
|
||||||
@@ -36,7 +36,7 @@ Struct Walkthrough
|
|||||||
This enables fine-grained speed control, supports differential drive configurations, and even allows for maneuvering in multi-directional platforms like omni-wheel robots.
|
This enables fine-grained speed control, supports differential drive configurations, and even allows for maneuvering in multi-directional platforms like omni-wheel robots.
|
||||||
|
|
||||||
Why Use __attribute((packed))?
|
Why Use __attribute((packed))?
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
ESP-NOW uses fixed-size data packets (up to 250 bytes). The *__attribute__((packed))* removes compiler-added padding for precise byte alignment.
|
ESP-NOW uses fixed-size data packets (up to 250 bytes). The *__attribute__((packed))* removes compiler-added padding for precise byte alignment.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user