From 0b86a2bb05939a29e2e9308dce72103be595874a Mon Sep 17 00:00:00 2001 From: Alexandre Bobkov Date: Sat, 5 Jul 2025 17:17:45 -0400 Subject: [PATCH] . --- ESP-IDF_Robot/tutorial/docs/source/data.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ESP-IDF_Robot/tutorial/docs/source/data.rst b/ESP-IDF_Robot/tutorial/docs/source/data.rst index b4e4c14b8..e62d910e2 100644 --- a/ESP-IDF_Robot/tutorial/docs/source/data.rst +++ b/ESP-IDF_Robot/tutorial/docs/source/data.rst @@ -29,4 +29,15 @@ Struct Walkthrough *led* allows the transmitter to toggle an onboard LED and is used for status indication (e.g. pairing, battery warning, etc). *motor1_rpm_pwm* to *motor4_rpm_pwm* 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. \ No newline at end of file +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))? +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The packed attribute tells the compiler not to add any padding between fields in memory. This makes the struct: + + - Compact + - Predictable for serialization over protocols like UART or ESP-NOW + - Ideal for low-latency transmission in embedded systems + +This ensures the receiver interprets the exact byte layout you expect, minimizing bandwidth and maximizing compatibility across platforms. \ No newline at end of file