mermaids
This commit is contained in:
37
mqtt_display/docs/critical_data_flow_points.mermaid
Normal file
37
mqtt_display/docs/critical_data_flow_points.mermaid
Normal file
@@ -0,0 +1,37 @@
|
||||
graph TD
|
||||
START[MPU reads @50ms = 20 Hz] --> A{IMU_CHANNEL<br/>try_send}
|
||||
|
||||
A -->|Full| DROP1[❌ DROP: Channel full<br/>16 slots @ 50ms = 800ms buffer]
|
||||
A -->|OK| B[Main Loop receive]
|
||||
|
||||
B --> C[Drain loop:<br/>Get freshest reading]
|
||||
C --> D{Time check:<br/>≥3s since last?}
|
||||
|
||||
D -->|No| E[Skip MQTT]
|
||||
D -->|Yes| F{mqtt_set_imu<br/>try_lock IMU_LATEST}
|
||||
|
||||
F -->|Locked| DROP2[❌ SKIP: Mutex busy]
|
||||
F -->|OK| G[Store payload]
|
||||
|
||||
E --> H[show_imu]
|
||||
G --> H
|
||||
|
||||
H --> I{DISPLAY_CHANNEL<br/>try_send}
|
||||
I -->|Full| DROP3[❌ DROP: Display slow<br/>8 slots @ 100ms = 800ms buffer]
|
||||
I -->|OK| J[Display renders]
|
||||
|
||||
G --> K[MQTT Task loop]
|
||||
K --> L{IMU_LATEST<br/>try_lock}
|
||||
|
||||
L -->|Empty/Locked| M[Skip this iteration]
|
||||
L -->|Has data| N[Send to broker<br/>QoS0 no retain]
|
||||
|
||||
N --> O{TCP send result}
|
||||
O -->|Fail| RECONNECT[❌ Session dies<br/>Reconnect in 5s]
|
||||
O -->|OK| P[✅ Data sent]
|
||||
|
||||
style DROP1 fill:#ffcccc
|
||||
style DROP2 fill:#ffcccc
|
||||
style DROP3 fill:#ffcccc
|
||||
style RECONNECT fill:#ffcccc
|
||||
style P fill:#ccffcc
|
||||
Reference in New Issue
Block a user