How astitz13/ecgr4101-virtual-pet-team13 works
This is an STM32-based virtual pet. The principal runtime is the firmware main loop: initialize sensors, audio timing, and the display; read user input and handle UI actions; update pet state; then show status and terminal screens. The tree also contains microphone and motion-sensor code, game and animation modules, sound assets, and USB-host audio support. Main-loop calls are supported by the excerpt; several other connections are uncertain because their implementation files were not sampled, so they are omitted or marked unverified.
Main entry points: main.c Main loop · ui.c UI screens · input.c Button input · usb_host.c USB host app
Components 19
Firmware Runtime
- Main loop
Core/Src/main.c - Button input
Core/Src/input.c
Pet Experience
- UI screens
Core/Src/ui.c - Pet state
Core/Src/pet.c - Game logic
Core/Src/game.c - Animation
Core/Src/anim.c - Image assets
Core/Src/imported_images.c
Hardware I/O
- Sensor setup
Core/Src/sensors.c - MPU6050 driver
Core/Src/mpu6050.c - Microphone capture
Core/Src/microphone.c - Audio timing
Core/Src/audio.c - Sound playback
Core/Src/sound.c - Audio assets
Core/Src/imported_audio.c - ILI9341 display
Drivers/BSP/GFX01M2/ili9341.c
USB Audio
- USB host app
USB_HOST/App/usb_host.c - USB host core
Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c - USB audio class
Middlewares/ST/STM32_USB_Host_Library/Class/AUDIO/Src/usbh_audio.c - USB target support
USB_HOST/Target/usbh_conf.c
Other components
- Pet user
Connections 18
- Pet user → Button input: presses buttons
- Button input → Main loop: provides input
- Main loop → Sensor setup: initializes
Core/Src/main.c - Main loop → Audio timing: initializes
Core/Src/main.c - Main loop → ILI9341 display: initializes
Core/Src/main.c - Main loop → Microphone capture: checks sound
Core/Src/main.c - Main loop → UI screens: updates screens
Core/Src/main.c - Main loop → Pet state: updates state
Core/Src/main.c - Main loop → Button input: reads buttons
- UI screens → ILI9341 display: draws screens
- Pet state → Game logic: uses game logic
- UI screens → Animation: uses animation
- Sensor setup → MPU6050 driver: uses driver
- Sound playback → Audio assets: uses sounds
- UI screens → Image assets: draws images
- USB host app → USB host core: uses host core
USB_HOST/App/usb_host.c - USB host app → USB audio class: registers audio
USB_HOST/App/usb_host.c - USB host core → USB target support: uses target config