bertrik / ElectronicLoad

Arduino software for an electronically controlled load, based on a STM32 microcontroller
https://www.tindie.com/products/jaspersikken/jaspers-electronic-load-r2/
MIT License
21 stars 6 forks source link

Can't compile with Arduino 1.8.5 #1

Closed reportingsjr closed 4 years ago

reportingsjr commented 4 years ago

Hi, I'm trying to update my electronic load and I can't seem to compile the code with Arduino 1.8.5. I am getting this error and I'm not sure why. Have you seen this before?

Arduino: 1.8.5 (Linux), Board: "Generic STM32F1 series, BluePill F103C8, Maple DFU Bootloader 2.0, Enabled (generic 'Serial'), None, Low/Full Speed, Smallest (-Os default), Newlib Nano (default)"

current.cpp:9: error: invalid conversion from 'int' to 'TIM_TypeDef' [-fpermissive] static HardwareTimer pwmtimer(2); ^ In file included from /home/jon/.arduino15/packages/STM32/hardware/stm32/1.7.0/cores/arduino/wiring.h:44, from /home/jon/.arduino15/packages/STM32/hardware/stm32/1.7.0/cores/arduino/Arduino.h:32, from sketch/current.cpp:4: /home/jon/.arduino15/packages/STM32/hardware/stm32/1.7.0/cores/arduino/HardwareTimer.h:90:32: note: initializing argument 1 of 'HardwareTimer::HardwareTimer(TIM_TypeDef)' HardwareTimer(TIM_TypeDef *instance);


sketch/current.cpp: In function 'void CurrentInit()':
current.cpp:29: error: 'PWM' was not declared in this scope
         pinMode(PIN_CURRENT_OUT, PWM);
                                  ^~~
sketch/current.cpp:29:34: note: suggested alternative: 'PWR'
         pinMode(PIN_CURRENT_OUT, PWM);
                                  ^~~
                                  PWR
sketch/current.cpp: In function 'float CurrentSetValue(float)':
current.cpp:69: error: 'PWM' was not declared in this scope
             pinMode(PIN_CURRENT_OUT, PWM);
                                      ^~~
sketch/current.cpp:69:38: note: suggested alternative: 'PWR'
             pinMode(PIN_CURRENT_OUT, PWM);
                                      ^~~
                                      PWR
current.cpp:70: error: 'pwmWrite' was not declared in this scope
             pwmWrite(PIN_CURRENT_OUT, pwm);
             ^~~~~~~~
sketch/current.cpp:70:13: note: suggested alternative: 'fwrite'
             pwmWrite(PIN_CURRENT_OUT, pwm);
             ^~~~~~~~
             fwrite
exit status 1
invalid conversion from 'int' to 'TIM_TypeDef*' [-fpermissive]
jrsikken commented 4 years ago

Hi Jon Neal, I am sorry. 11 months ago I have quit selling the product because sales dropped dramatically and there are cheaper and more powerful electronics loads on aliexpress. Maybe my brother Bertrik Sikken in CC, who developed the embedded software (also on linux), can give some tips. Best, Jasper

On Mon, Oct 28, 2019 at 12:53 PM Jon Neal notifications@github.com wrote:

Hi, I'm trying to update my electronic load and I can't seem to compile the code with Arduino 1.8.5. I am getting this error and I'm not sure why. Have you seen this before?

Arduino: 1.8.5 (Linux), Board: "Generic STM32F1 series, BluePill F103C8, Maple DFU Bootloader 2.0, Enabled (generic 'Serial'), None, Low/Full Speed, Smallest (-Os default), Newlib Nano (default)"

current.cpp:9: error: invalid conversion from 'int' to 'TIM_TypeDef' [-fpermissive] static HardwareTimer pwmtimer(2); ^ In file included from /home/jon/.arduino15/packages/STM32/hardware/stm32/1.7.0/cores/arduino/wiring.h:44, from /home/jon/.arduino15/packages/STM32/hardware/stm32/1.7.0/cores/arduino/Arduino.h:32, from sketch/current.cpp:4: /home/jon/.arduino15/packages/STM32/hardware/stm32/1.7.0/cores/arduino/HardwareTimer.h:90:32: note: initializing argument 1 of 'HardwareTimer::HardwareTimer(TIM_TypeDef)' HardwareTimer(TIM_TypeDef

instance); ~~~^~ sketch/current.cpp: In function 'void CurrentInit()': current.cpp:29: error: 'PWM' was not declared in this scope pinMode(PIN_CURRENT_OUT, PWM); ^~~ sketch/current.cpp:29:34: note: suggested alternative: 'PWR' pinMode(PIN_CURRENT_OUT, PWM); ^~~ PWR sketch/current.cpp: In function 'float CurrentSetValue(float)': current.cpp:69: error: 'PWM' was not declared in this scope pinMode(PIN_CURRENT_OUT, PWM); ^~~ sketch/current.cpp:69:38: note: suggested alternative: 'PWR' pinMode(PIN_CURRENT_OUT, PWM); ^~~ PWR current.cpp:70: error: 'pwmWrite' was not declared in this scope pwmWrite(PIN_CURRENT_OUT, pwm); ^~~~ sketch/current.cpp:70:13: note: suggested alternative: 'fwrite' pwmWrite(PIN_CURRENT_OUT, pwm); ^~~~ fwrite exit status 1 invalid conversion from 'int' to 'TIM_TypeDef' [-fpermissive]

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bertrik/ElectronicLoad/issues/1?email_source=notifications&email_token=AAIEXZ6W2BP5QLO5TPAKI6DQQ3HEBA5CNFSM4JFZDZ42YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HUXWRIA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIEXZ6FYQE2ZUMQGW4CP53QQ3HEBANCNFSM4JFZDZ4Q .

-- Jasper Sikken, Merwedekade 157 bis, 3522 JC Utrecht, tel:0655523064 http://www.linkedin.com/in/jaspersikken/

reportingsjr commented 4 years ago

So I followed the platformio instructions on the wiki and eventually got things working. Thanks!