Initial Demo OS

This commit is contained in:
dark98
2026-09-03 00:46:04 +01:00
commit 1491821e96
45 changed files with 2908 additions and 0 deletions
+76
View File
@@ -0,0 +1,76 @@
# ABrobot ESP32-C3 0.42" OLED — Micro-OS
A modular, lightweight **Embedded Micro-OS** built for the **ABrobot ESP32-C3** development board equipped with the integrated **0.42" (72x40) monochrome OLED display**.
---
## 🏛️ System Architecture
```
d:/Projects/ESP32C3/OS/
├── components/
│ ├── sys_core/ # Event bus (sys_event) & global state telemetry (sys_status)
│ ├── sys_input/ # Single-button gesture engine (Click, Double-Click, Hold, Home)
│ ├── sys_gfx/ # 72x40 UI compositor, OLED driver, 5x7 & 3x5 fonts, status/action bars, widgets
│ ├── sys_app/ # App lifecycle manager, registry, and Home App Launcher
│ └── sys_cli/ # Interactive USB Serial/JTAG shell (ps, free, app, input, reboot)
├── main/
│ ├── apps/
│ │ ├── apps.h # System apps registry
│ │ ├── app_clock.c # Clock / Watchface app (multiple view modes, live seconds bar)
│ │ ├── app_sysmon.c # Real-time System Monitor (live RAM sparkline graph, tasks, specs)
│ │ ├── app_settings.c # Settings app (contrast, inverted colors, statusbar toggle, reboot)
│ │ └── app_game.c # Tiny Jump retro runner mini-game
│ ├── CMakeLists.txt
│ └── main.c # OS bootstrap, LED heartbeat, and 20 FPS compositor loop
├── sdkconfig.defaults # ESP32-C3 target & USB Serial/JTAG console defaults
└── README.md
```
---
## 🎮 Single-Button Gesture Controls (`GPIO 9`)
| Gesture | Timing | Action |
| :--- | :--- | :--- |
| **Short Click** | $< 350\text{ ms}$ | **Next / Step / Jump:** Cycle menu items, change clock view, jump in mini-game |
| **Double Click** | 2 clicks in $280\text{ ms}$ | **Previous / Back:** Cycle menu backwards |
| **Long Press** | $\ge 450\text{ ms}$ | **Select / Toggle:** Launch selected app, toggle settings |
| **Hold (Home)** | $\ge 1500\text{ ms}$ | **Global Home:** Return to the system App Launcher from any app |
---
## 💻 Interactive USB CLI Console
Connect the board via USB-C and open the serial monitor to access the live OS terminal:
```text
esp32c3-os> help
help List all commands
ps List active FreeRTOS tasks and memory
free Display system heap and RAM status
app App management (list, launch <id>, home)
input Simulate button input (click, double, long, home)
contrast Set OLED contrast (0-255)
reboot Reboot the MCU
```
### Examples:
- Switch to the game remotely: `app launch game`
- Trigger a jump remotely: `input click`
- Inspect tasks: `ps`
- Return to home menu: `app home`
---
## 🚀 How to Build and Flash
In your ESP-IDF terminal environment:
```bash
# 1. Build the project
idf.py build
# 2. Flash to the board and open the serial monitor
idf.py -p COMx flash monitor
```