mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-07-07 04:58:00 +02:00
83 lines
3.8 KiB
XML
83 lines
3.8 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800">
|
|
<style>
|
|
.bg{fill:#0a0a0f}.pnl{fill:#12121a;stroke:#1a1a2e}.hdr{fill:#12121a}
|
|
.title{font:bold 42px 'Courier New',monospace;fill:#00ff41}
|
|
.sub{font:bold 28px 'Courier New',monospace;fill:#00d4ff}
|
|
.txt{font:24px 'Courier New',monospace;fill:#c0c0c0}
|
|
.dim{font:20px 'Courier New',monospace;fill:#888}
|
|
.grn{font:bold 24px 'Courier New',monospace;fill:#00ff41}
|
|
.red{font:bold 24px 'Courier New',monospace;fill:#ff0040}
|
|
.cyn{font:bold 24px 'Courier New',monospace;fill:#00d4ff}
|
|
.amb{font:bold 24px 'Courier New',monospace;fill:#ffaa00}
|
|
.badge{stroke:#00ff41;rx:14}
|
|
</style>
|
|
<rect class="bg" width="1200" height="800"/>
|
|
|
|
<!-- Title -->
|
|
<text x="600" y="52" text-anchor="middle" class="title">Source Code</text>
|
|
<text x="600" y="88" text-anchor="middle" class="dim">0x0014_static-variables.c</text>
|
|
|
|
<!-- Code Panel -->
|
|
<rect x="40" y="110" width="700" height="510" rx="8" class="pnl"/>
|
|
<text x="390" y="148" text-anchor="middle" class="sub">main()</text>
|
|
|
|
<rect x="60" y="168" width="660" height="440" rx="4" fill="#0a0a0f" stroke="#1a1a2e" stroke-width="1"/>
|
|
<text x="80" y="198" class="cyn">int main(void) {</text>
|
|
<text x="110" y="226" class="txt">stdio_init_all();</text>
|
|
<text x="110" y="254" class="dim">// GPIO setup</text>
|
|
<text x="110" y="282" class="txt">gpio_init(15);</text>
|
|
<text x="110" y="310" class="txt">gpio_set_dir(15, GPIO_IN);</text>
|
|
<text x="110" y="338" class="amb">gpio_pull_up(15);</text>
|
|
<text x="110" y="366" class="txt">gpio_init(16);</text>
|
|
<text x="110" y="394" class="txt">gpio_set_dir(16, GPIO_OUT);</text>
|
|
<text x="110" y="430" class="cyn">while (true) {</text>
|
|
<text x="140" y="458" class="txt">uint8_t reg = 42;</text>
|
|
<text x="140" y="486" class="grn">static uint8_t s = 42;</text>
|
|
<text x="140" y="514" class="txt">printf(... reg, s);</text>
|
|
<text x="140" y="542" class="red">reg++; s++;</text>
|
|
<text x="110" y="570" class="cyn">}</text>
|
|
<text x="80" y="590" class="cyn">}</text>
|
|
|
|
<!-- Annotations -->
|
|
<rect x="780" y="110" width="380" height="180" rx="8" class="pnl"/>
|
|
<text x="970" y="148" text-anchor="middle" class="sub">GPIO Setup</text>
|
|
|
|
<text x="800" y="183" class="grn">Pin 15:</text>
|
|
<text x="920" y="183" class="txt">Input</text>
|
|
<text x="800" y="213" class="dim">Pull-up enabled</text>
|
|
|
|
<text x="800" y="248" class="amb">Pin 16:</text>
|
|
<text x="920" y="248" class="txt">Output</text>
|
|
<text x="800" y="268" class="dim">LED control</text>
|
|
|
|
<!-- Serial Output -->
|
|
<rect x="780" y="310" width="380" height="200" rx="8" class="pnl"/>
|
|
<text x="970" y="348" text-anchor="middle" class="sub">Serial Output</text>
|
|
|
|
<rect x="800" y="370" width="340" height="115" rx="4" fill="#0a0a0f" stroke="#1a1a2e" stroke-width="1"/>
|
|
<text x="820" y="397" class="txt">reg: 42</text>
|
|
<text x="820" y="422" class="txt">s: 42</text>
|
|
<text x="820" y="447" class="txt">reg: 42</text>
|
|
<text x="820" y="472" class="grn">s: 43</text>
|
|
|
|
<text x="800" y="498" class="dim">reg always 42, s grows</text>
|
|
|
|
<!-- Button Logic -->
|
|
<rect x="780" y="530" width="380" height="90" rx="8" class="pnl"/>
|
|
<text x="970" y="565" text-anchor="middle" class="sub">Button Logic</text>
|
|
|
|
<text x="800" y="598" class="dim">pressed = gpio_get(15);</text>
|
|
|
|
<!-- Key -->
|
|
<rect x="40" y="640" width="1120" height="140" rx="8" class="pnl"/>
|
|
<text x="600" y="678" text-anchor="middle" class="sub">Key Behaviors</text>
|
|
|
|
<rect x="60" y="698" width="340" height="55" rx="4" fill="#0a0a0f" stroke="#ff0040" stroke-width="1"/>
|
|
<text x="230" y="730" text-anchor="middle" class="red">reg: always 42</text>
|
|
|
|
<rect x="420" y="698" width="340" height="55" rx="4" fill="#0a0a0f" stroke="#00ff41" stroke-width="1"/>
|
|
<text x="590" y="730" text-anchor="middle" class="grn">s: 42,43,44...</text>
|
|
|
|
<rect x="780" y="698" width="360" height="55" rx="4" fill="#0a0a0f" stroke="#ffaa00" stroke-width="1"/>
|
|
<text x="960" y="730" text-anchor="middle" class="amb">wraps at 255->0</text>
|
|
</svg> |