- outsource global variables and objects
- move from config.hpp to global.cpp / hpp
- rename config.hpp, thus change all includes
- re-arrange includes -> in source files instead of header
- optimize / make function comment titles more consistent
- optimize comments overall
- add several temporary files to gitignore
- fix unused variable compiler warnings
- add static type to all local variables in every source file
so the scope of each variable is limited to that file.
This prevents conflicting variable names with other source file
(e.g. 'state' variable in vfd.cpp)
- simplify encoder concept
wrap all used functions from rotary_encoder.h library in
custom encoder.hpp file
-> only one file has to be included where encoder is used
-> global variable 'encoder' is not necessary anymore
-> reduces duplicate code for length calculation
- update all files where encoder functions where used accordingly
- Basic lamp functionality: simply turn on when not in COUNTING or TARGET_REACHED
state
- Remove unnecessary comments, fix code formatting in several files
control.cpp:
- Add new systemState CUTTING
- change systemState_t from enum to enum class (conflicting with
cutter enum)
- Add CUTTING functionality to CUT switch and auto cut after target
reached if enabled
cutter.cpp:
- Add function cutter_isRunning()
config:
- Add GPIO_LAMP macro to config
To abstract rather complex functions for 7 segment displays e.g. blink text, scroll
text... a class was created.
This makes it possible to have 2 instances for displayTop and
displayBottom resulting in no duplicate code
vfd: extend vfd_setState function with direction enum (default fwd)
main: reduce log output from buzzer task
config: use mos1 as vfd_FWD output
control:
add MANUAL state: motor can be controlled via preset buttons
adjust code slightly to support new state (also see updated
function-diagram)
Add readadc function from armchair project
Rework display section
- show lengthNow on first display
- show lengthTarget on second display
Prepare for statemachine
Remove unneeded function
Add comments improve structure
Add vfd.cpp/hpp with functions to control the VFD via 4 digital pins
Add way to test the vfd via SET button (rotate speed level) and START
button (toggle motor on/off)
- move code from testing task to control.cpp
- outsource functions for initializing display and encoder
- delete testing code
- add two display pages (current distance and counter)
- run handle functions for each button
Add config.cpp/hpp
- macros for all input and output pins
- gloabl evaluated switch objects
- buzzer object
- display config
- encoder config
Move main.c to main.cpp and adjust code to be c++ compatible
add custom library evaluated switch (copied from armchair project)
add buzzer object (copied from armchair project)
add control.cpp/hpp with control task (no function yet)