How tghan98/surearly-multi works
This is embedded firmware for an STM8L15x optical stick-testing device. The main loop initializes hardware and repeatedly runs a test sequence: check insertion and usage, acquire optical measurements, evaluate the sample, and present status on the LCD. Supporting branches handle stored scan counts, hardware access, and timer/ADC/serial interrupts. The README is empty; relationships below are limited to calls and references shown in the supplied excerpts and SOURCE INDEX, so peripheral-level wiring is not expanded.
Main entry points: DM_Main_Sq_App.c Test sequence · DM_Optic_Handle_App.c Optical sensing · User_Main.c User runtime · DM_HW_Drv.c Hardware driver
Components 14
Firmware runtime
- Entry point
Core/main/main.c - User runtime
USER/User_Main.c - Interrupt handlers
Core/main/stm8l15x_it.c
Test workflow
- Test sequence
USER/App/DM_Main_Sq_App.c - Optical sensing
USER/App/DM_Optic_Handle_App.c - LCD and stick status
USER/App/DM_LCD_Stick_Check_App.c - Usage data
USER/App/DM_Rom_Handl_App.c - Test parameters
USER/Parameter_define.h
Hardware access
- Hardware driver
USER/Drive/DM_HW_Drv.c - Calculation utilities
USER/Utill/DM_Utill.c
MCU platform
- STM8 peripheral library
Core/STM8L15x_StdPeriph_Driver/src - Device definitions
Core/STM8L15x_StdPeriph_Driver/inc/stm8l15x.h - Peripheral configuration
Core/main/stm8l15x_conf.h
Other components
- Test stick
Connections 16
- Entry point → User runtime: initializes and runs
Core/main/main.c - User runtime → Hardware driver: initializes hardware
USER/User_Main.c - User runtime → Test sequence: processes sequence
USER/User_Main.c - User runtime → Interrupt handlers: handles interrupts
- Test sequence → Optical sensing: measures stick
USER/App/DM_Main_Sq_App.c - Test sequence → Usage data: reads and updates counts
USER/App/DM_Main_Sq_App.c - Test sequence → LCD and stick status: sets display steps
USER/App/DM_Main_Sq_App.c - Test sequence → Hardware driver: sleeps
USER/App/DM_Main_Sq_App.c - Test sequence → Calculation utilities: uses calculations
USER/App/DM_Main_Sq_App.c - Optical sensing → Hardware driver: reads sensors
USER/App/DM_Optic_Handle_App.c - Optical sensing → Usage data: uses stored data
USER/App/DM_Optic_Handle_App.c - LCD and stick status → Optical sensing: checks stick presence
USER/App/DM_LCD_Stick_Check_App.c - Usage data → Hardware driver: accesses storage
USER/App/DM_Rom_Handl_App.c - Test sequence → Test parameters: uses thresholds
USER/App/DM_Main_Sq_App.c - Test stick → Optical sensing: reflects light
- Peripheral configuration → Device definitions: includes definitions
Core/main/stm8l15x_conf.h