thankthemaker / rESCue

rESCue - add more safety and control to your VESC based vehicle
GNU General Public License v3.0
104 stars 27 forks source link

Support added for avaspark-rgb board target. Fixed being able to d… #65

Closed Relys closed 1 year ago

Relys commented 1 year ago

…efine CAN bus pins as opposed to hardcoded. Overloaded Ws28xxController setPixelColor functions to support seperate front/back GPIO pins for LEDs.

Relys commented 1 year ago

GPT4 output of commit diff:

`It appears that you're presenting code changes, most likely in a diff format, related to a project that involves embedded systems programming for a device such as an ESP32 microcontroller. The changes touch several aspects of the project, including CAN device communication, LED control, hardware pin configurations, and general system setup. Below, I'll provide an analysis of the changes made in each section.

  1. platformio.ini: The updates in this file mainly concern the build configurations, including the definition of new pins and associated flags. It seems the changes allow customization and tuning for various environments and hardware configurations. For example, the [AVASPARK-ANDONN] section outlines various pins related to WS28xx LED stripes and Cheap Focer 2 configurations.
  2. src/CanDevice.cpp and src/CanDevice.h: Changes here focus on how the CAN GPIO pins are handled. Previously, the pins were hardcoded in the init() method, but now they are mapped via macros, allowing them to be configured through the PlatformIO INI file.
  3. src/LedControllerFactory.cpp: Changes to this file support the use of separate front and back pins for LED control, rather than using a single pin configuration. This adds flexibility in handling different LED setups.
  4. src/Ws28xxController.cpp and src/Ws28xxController.h: These changes seem to be the core of the new feature for handling separate front and back pins for controlling WS28xx LED stripes. It includes defining constructors for single-pin and two-pin configurations, as well as handling different behavior for each configuration in methods like setPixelColor, show, and numPixels.
  5. src/main.cpp: The changes here include the implementation of new features defined elsewhere. For example, the setup of the debug LED, the initiation of the LED controller with support for new pins, and the setup of pins related to direction and brake of what seems to be an electric motor. The setup and loop functions in this file appear to represent the main lifecycle of the embedded application.

These changes collectively seem to enhance the configurability, flexibility, and possibly the functionality of the system by adding support for new hardware components and allowing for easier modifications through build configuration. Some potential applications might include electric vehicle control, robotic systems, or any embedded system that requires sophisticated control of motors, LEDs, and other peripherals.`

Relys commented 1 year ago

Creating new PR with board name changed.