RoboDurden / Hoverboard-Firmware-Hack-Gen2.x

with different defines_2-x.h for different board layouts :-) Compiles with Keil version 6
GNU General Public License v3.0
73 stars 24 forks source link

NOW rc EspressLRS support (CRSF decoder) !!! #26

Open RoboDurden opened 9 months ago

RoboDurden commented 9 months ago

Thanks to @WizzardDr who implemented the code: https://github.com/RoboDurden/Hoverboard-Firmware-Hack-Gen2.x/pull/24

In config.h you have to uncomment the "remote" you want to use:

#define REMOTE_DUMMY
//#define REMOTE_UART
//#define REMOTE_CRSF

In remote.h you could include new remotes like RemoteAdc or RemotePwm, etc.

    void RemoteCallback(void);      // must be implemented by all remotes
    void RemoteUpdate(void);            // must be implemented by all remotes

    #ifdef REMOTE_UART
        #include "../Inc/remoteUart.h"
    #endif
    #ifdef REMOTE_CRSF
        #include "../Inc/remoteCrsf.h"
    #endif
    #ifdef REMOTE_DUMMY
        #include "../Inc/remoteDummy.h"
    #endif

I have tested REMOTE_UART and REMOTE_DUMMY on my 2.0 test setup with only the one board running as the master. Have burned the second board some time ago so i at the moment can not test the master-slave communication between two boards.

Next step for a more complete firmware would be an abstract pilot.h class and implementing classes pilotPwm.c, pilotSpeed.c, pilotTorque.c, pilotDistance.c , etc. that contain the closed loop for various tasks.

But as today i also finished the I2C control of the new SimpleFOC firmware for these split boards, this next step might be for you who first put the closed loop into main.c and then like with WizzardDr i move the code into such a pilot system.

You can also test the new SimpleFOC firmware with an I2C remote (still called pilot there). This is the arduino code: https://github.com/RoboDurden/Split_Hoverboard_SimpleFOC/tree/main/arduino%20examples/ESP32_Mini_S2_I2c_Master

Ideas welcome.

Here in this issue please test and report the new REMOTE_CRSF.

For problems with the new SimpleFOC firmware, open issues in that other repo of mine.

Thanks again to WizzardDr for contributing !!!