- outsource configuration of display and encoder from source/header file
to config.cpp and pass it to init function or task from main()
- optimize logging in several init functions
- speedsensor:
- fix startup error: initialize ISR only once
- create instances at initialization instead of first method call
- ssd1306 display library:
- modify library to pass offsetX to init function instead of using macro
- All files:
Modify almost all files to adjust functions and classes to
work with pointers to objects passed at task creation
instead of global variables from config.hpp
- Remove/clear config.hpp to get rid of all global variables
- main.cpp
- Create pointer to all shared (used in multiple tasks) objects in main
- remove evaluatedSwitch button object,
since joystick library is used to get switch events
- changes HTTP-mode
- always init http-server (do not enable/disable at mode change)
- pass url-handle function to init-htpp function
- add lambda function to pass method of instance for thatMajor Rework all files - Remove global variables, pass pointers to tasks
- All files:
Modify almost all files to adjust functions and classes to
work with pointers to objects passed at task creation
instead of global variables from config.hpp
- Remove/clear config.hpp to get rid of all global variables
- main.cpp
- Create pointer to all shared (used in multiple tasks) objects in main
- remove evaluatedSwitch button object,
since joystick library is used to get switch events
- changes HTTP-mode
- always init http-server (do not enable/disable at mode change)
- pass url-handle function to init-htpp function
- add lambda function to pass method of instance for that
NOTES: - tested on breakoutboard only
- known issue that slow encoder events are not recognized
(especially in menu) - slowing down motorctl helps
Simple functions for printing a line normal, large or centered
using format string directly instead of having to use both
snprintf first and then display function all the time
This makes the code more readable and compact
Applied this optimization where applicable in manu.cpp and display.cpp
- move speedsensor files from motorctl pcb to common
- single pcb create and configure global speedsensor objects
- display: create fast slow veryslow loop
- clear display every 30s
- show speed in rpm and km/h
NOTE: speedsensor needs fix, direction unreliable
slightly rework hacked display test
- new code structure
- split code in several functions
- add task for display instead of running it in main()
- functions to convert voltage to battery percent charged
- show percentage and voltage on display