4 Commits

Author SHA1 Message Date
jonny
1d4e83a2ea Store encoder-steps at shutdown, consider at startup
shutdown:
    - add functions to read/write last encoder steps from nvs
    - store encoder steps at shutdown

guide:
    - add function to calculate layer count from cable length
    - read last encoder-steps at startup
    - if length >2m calculate layers, dont home
    - home at move-to-zero when not done at startup

encoder library:
    - add function to set encoder steps

control:
    - read last encoder-steps at startup
    - apply last steps if >2m
2024-03-14 16:06:20 +01:00
jonny
4aab1e1343 Outsource global variables, Optimize comments
- 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
2024-03-10 12:55:13 +01:00
jonny_ji7
ac4ca5450a Fix variable scopes (static), Simplify encoder
- 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
2023-03-01 01:00:16 +01:00
jonny_ji7
5dd392586d Outsource encoder code to encoder.cpp
To be able to use the encoder in future stepper task as well
- make certain variables global
- initialize encoder in main
- outsorce encoder functions in encoder.cpp / h
- adjust config
2023-03-01 00:09:29 +01:00