This document summarizes the user applications and demos found in the User/ directory of StumpOS. Each process demonstrates core RTOS features, multitasking, and interaction with hardware peripherals.
Purpose:
Implements an alarm that draws user attention using LCD, buzzer, and vibration until the user dismisses it.
Interaction:
- Forces exclusive control of the buzzer, vibration, keypad, and LCD.
- Continually displays "Press the keypad to dismiss" on the LCD.
- Cycles through a melody and toggles the vibration motor.
- Dismisses and deactivates when any key is pressed, stopping all outputs.
Purpose:
The system boot UI and launcher for all user programs.
Interaction:
- Plays a boot melody and sets up UI buffers.
- Displays program list, overall status, and navigation via switches:
- SW-A/C: Page left/right
- SW-E: Start program
- SW-F: Pause/resume
- SW-G: Kill/exit
- Shows per-process status (INACTIVE, PAUSED, RUNNING).
- Redraws UI upon input events with efficient selective updates.
Purpose:
Interactive LED matrix animation: launches fireworks when keys are pressed.
Interaction:
- Forces exclusive access to the LED matrix and keypad.
- Keypad input spawns a "firework" of different colors, animating up the matrix with effects and fading.
- Manages and animates a linked list of firework objects.
- Each color can be randomized, and fireworks are removed after animation completes.
Purpose:
Displays a smooth, periodic sine wave animation on the LED matrix.
Interaction:
- Cycles through a precomputed sine table to illuminate the LED matrix in an animated fashion.
- Updates the display on each tick, yielding after each frame.
- Demonstrates use of table-driven animation and continuous system resource usage.
Purpose:
A demo that deliberately triggers a kernel panic for debugging or demonstration.
Interaction:
- Immediately invokes the panic syscall when launched.
- Shows the crash handler and plays a distress melody.
Purpose:
Implements a hardware reset process, triggered by Spartan board buttons.
Interaction:
- Claims control of the Spartan board buttons.
- Continuously polls Spartan buttons; on press, causes a system reset (using PC manipulation).
- Useful for resetting demos or returning to boot state during demonstrations.
Purpose:
Plays a non-blocking melody (specifically, "Never Gonna Give You Up") using the buzzer.
Interaction:
- Claims the buzzer and iterates the melody table.
- Iteratively plays each note, restarts from the beginning after completion.
- Yields periodically so multitasking continues.
Purpose:
A powerful and interactive timer application for the LCD and hardware buttons/keypad.
Interaction:
- Allows the user to set timers using buttons or keypad.
- Displays, increments/decrements, starts, resets, and exits via dedicated buttons.
- Handles precise timekeeping using the RTC, and triggers the alarm process when done.
- Splits responsibilities between foreground (UI, input) and background (timer ticking).
- All userspace applications utilize the StumpOS syscall ABI for peripheral control.
- Each process is an example of low-memory, full-featured assembly RTOS programming and demonstrates proper device arbitration and multitasking.
See the source for more implementation details and to explore how processes interact and coordinate with the StumpOS kernel.