jonny_jr9 2fcf17feda Major Rework all files - Pass pointers to tasks, Remove gloabl variables
- 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
2024-02-18 10:00:34 +01:00

57 lines
1.5 KiB
C++

#pragma once
#include "motordrivers.hpp"
#include "motorctl.hpp"
#include "joystick.hpp"
#include "gpio_evaluateSwitch.hpp"
#include "buzzer.hpp"
#include "control.hpp"
#include "fan.hpp"
#include "http.hpp"
#include "auto.hpp"
#include "speedsensor.hpp"
#include "chairAdjust.hpp"
//
////in IDLE mode: set loglevel for evaluatedJoystick to DEBUG
////and repeatedly read joystick e.g. for manually calibrating / testing joystick
////#define JOYSTICK_LOG_IN_IDLE
//
//
////TODO outsource global variables to e.g. global.cpp and only config options here?
//
////create global controlledMotor instances for both motors
//extern controlledMotor motorLeft;
//extern controlledMotor motorRight;
//
////create global joystic instance
//extern evaluatedJoystick joystick;
//
////create global evaluated switch instance for button next to joystick
//extern gpio_evaluatedSwitch buttonJoystick;
//
////create global buzzer object
//extern buzzer_t buzzer;
//
////create global control object
//extern controlledArmchair control;
//
////create global automatedArmchair object (for auto-mode)
//extern automatedArmchair_c armchair;
//
////create global httpJoystick object
////extern httpJoystick httpJoystickMain;
//
////configuration for fans / cooling
//extern fan_config_t configCooling;
//
////create global objects for measuring speed
//extern speedSensor speedLeft;
//extern speedSensor speedRight;
//
////create global objects for controlling the chair position
//extern cControlledRest legRest;
//extern cControlledRest backRest;
//
//