SolidGeek / VescUart

An Arduino library for interfacing with the VESC over UART
GNU General Public License v3.0
177 stars 92 forks source link

Integration with esphome #40

Open bogdanr opened 1 year ago

bogdanr commented 1 year ago

I am trying to integrate this with esphome.

My config is as follows:

substitutions:
  id: test3d1mini32
  project: Test D1 Mini32
esphome:
  name: $id
  libraries:
    - solidgeek/VescUart
esp32:
  board: wemos_d1_mini32
  framework:
    type: arduino
    version: 2.0.4

I receive the following error when I try to compile this:

In file included from /data/test3d1mini32/.piolibdeps/test3d1mini32/VescUart/src/VescUart.cpp:2:
/data/test3d1mini32/.piolibdeps/test3d1mini32/VescUart/src/VescUart.h:27:9: error: redeclaration of 'float VescUart::dataPackage::tempMotor'
   float tempMotor;
         ^~~~~~~~~
/data/test3d1mini32/.piolibdeps/test3d1mini32/VescUart/src/VescUart.h:14:9: note: previous declaration 'float VescUart::dataPackage::tempMotor'
   float tempMotor;
         ^~~~~~~~~
/data/test3d1mini32/.piolibdeps/test3d1mini32/VescUart/src/VescUart.cpp: In member function 'bool VescUart::processReadPacket(uint8_t*)':
/data/test3d1mini32/.piolibdeps/test3d1mini32/VescUart/src/VescUart.cpp:219:3: error: jump to case label [-fpermissive]
   default:
   ^~~~~~~
/data/test3d1mini32/.piolibdeps/test3d1mini32/VescUart/src/VescUart.cpp:217:13: note:   crosses initialization of 'uint32_t mask'
    uint32_t mask = 0xFFFFFFFF;
             ^~~~
/data/test3d1mini32/.piolibdeps/test3d1mini32/VescUart/src/VescUart.cpp:223:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
*** [/data/test3d1mini32/.pioenvs/test3d1mini32/libd76/VescUart/VescUart.cpp.o] Error 1

How can I work around this? What version of Arduino is it compatible with?

SolidGeek commented 1 year ago

I might have introduced a compile error in a previous pull request. I have updated the development branch, could you please give it a try?: VescUart/tree/development

bogdanr commented 8 months ago

It compiles fine with the code from the development branch.