mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-09 23:21:17 +00:00
.
This commit is contained in:
@@ -64,7 +64,8 @@ This enables fine-grained speed control, supports differential drive configurati
|
||||
</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>
|
||||
<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>
|
||||
<blockquote>
|
||||
<div><ul class="simple">
|
||||
<li><p>Compact</p></li>
|
||||
|
Reference in New Issue
Block a user