59 Commits

Author SHA1 Message Date
jonny_jr9
71b63ebbd3 Make drivers interchangeable, Switch to sabertooth driver
- make motorctl compatible with different drivers
    - pass set function instead of specific motor object
    - add lambda function in config.cpp
- update config to use one new sabertooth driver instead of two single100a
- main test controlled motor
2023-09-08 12:09:52 +02:00
jonny_jr9
98956e2bf8 Create class sabertooth2x60a - new driver functional
currently repeatedly sends test commands from main using a created
instance of that new class
2023-09-07 16:37:14 +02:00
jonny_jr9
a30ec01818 Simple driver test - works
test controlling driver via uart (in main function)
2023-09-07 14:02:48 +02:00
jonny_jr9
f76db1d9bc Outsource http, joystick to common/ and react-app to root
Same reason as before commit
Note: some changes to http were necessary due to global object
- untested!

Also remove unneded duplicate components folder
2023-09-07 12:59:15 +02:00
jonny_jr9
13b896accb Outsource currentsensor, motorctl, motordrivers to common/
since board_single uses mostly the same code as board_control and
board_motorctl several files are outsorced to common folder to prevent
dupliate code and different versions
2023-09-07 12:30:22 +02:00
jonny_jr9
446c246f43 Add message framing (start, end, escape bytes) to UART
Same functionality as previous commit. But way more stable and clean.
Previous proof of concept approach had issues with random partial or
too large messages due to time based method
Rework send and receive functions to work more stable
- send: encode data with frame (start, end byte)
- receive: read each byte one after the other, assemble message,
  handle actual data in handle function
- add semaphore to write operation to prevent parallel write of
  different data when called from other tasks
2023-08-30 18:17:20 +02:00
jonny_jr9
1e544613ee send, receive, apply motorCommands works (proof of concept); add timeout
- board_control successfully sends motor commands to board_motorctl
- board_motorctl receives and applies motor commands
note: control pcb currently switches to HTTP mode after startup for testing
with data from ui

- partially commented in code that has to be reworked
- control: send commands via uart instead of to motor objects
- board motorctl handled motor: add timeout when no target data
  received (e.g. control pcb offline / uart bugged)
- board motorctl uart: receive motorCommands_t struct and apply data to
  target state of handled motors
- types: fix issue with global motorstateStr variable
2023-08-30 09:01:44 +02:00
jonny_jr9
3722b0af74 Add uart templates, send and receive tasks with templates work
both boards compile and send/receive example data using new templates in
common uart code
common/uart_common.hpp
2023-08-30 09:01:31 +02:00
jonny_jr9
76e8bac113 2 boards: split code, outsource common, remove duplicate files
- outsoruce common files and separate common types from source files (new
  common/types.hpp)
- split source files to 2 board folders (relevant only, no duplicate)
- currently boards compile successfull but not functional at all
- comment out currently incompatible code
2023-08-30 09:01:13 +02:00