Skip to content

[BUG] Compile error with Arduino MEGA 2560 #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ator1811 opened this issue Jun 6, 2022 · 1 comment
Closed

[BUG] Compile error with Arduino MEGA 2560 #190

ator1811 opened this issue Jun 6, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ator1811
Copy link

ator1811 commented Jun 6, 2022

Hi,

I get a compile error when I compile the Encoder example with an Arduino Mega 2560 board Arduino-FOC/examples/utils/sensor_test/encoder/encoder_example/ I'm on version Simple Foc version 2.2.2.
It says:

/...../Arduino/libraries/Simple_FOC/src/drivers/hardware_specific/atmega2560_mcu.cpp: In function 'void* _configure6PWM(long int, float, int, int, int, int, int, int)':
/...../Arduino/libraries/Simple_FOC/src/drivers/hardware_specific/atmega2560_mcu.cpp:149:22: error: expected primary-expression before ',' token
     .pins = { pinA_h,, pinA_l, pinB_h, pinB_l, pinC_h, pinC_l },
                      ^
/..../Arduino/libraries/Simple_FOC/src/drivers/hardware_specific/atmega2560_mcu.cpp:151:6: error: request for member 'dead_zone' in 'pwm_frequency', which is of non-class type 'long int'
     .dead_zone = dead_zone
      ^~~~~~~~~
/..../Arduino/libraries/Simple_FOC/src/drivers/hardware_specific/atmega2560_mcu.cpp:152:3: error: could not convert '{{pinA_h, <expression error>, pinA_l, pinB_h, pinB_l, pinC_h, pinC_l}, <expression error>}' from '<brace-enclosed initializer list>' to 'GenericDriverParams'
   };
   ^

Compilation error: exit status 1

What is wrong? It looks like the error is caused by a typo in the code, but I'm not sure. Compiled with an Arduino Uno gives no problems.

Regards

@runger1101001
Copy link
Member

Yeah, its a typo. You can just remove the extra ,

We'll fix the example for the next release, and very sorry for the inconvenience!

@runger1101001 runger1101001 added bug Something isn't working and removed possible bug labels Jun 7, 2022
@runger1101001 runger1101001 self-assigned this Jun 7, 2022
@askuric askuric closed this as completed Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants