DeqingSun / ch55xduino

An Arduino-like programming API for the CH55X
GNU Lesser General Public License v2.1
448 stars 86 forks source link

Is it possible to use sqrt() in ch552? #137

Closed ZerooNight closed 1 year ago

ZerooNight commented 1 year ago

擷取 i try sqrt(2),and it shows the error

DeqingSun commented 1 year ago

The compiler SDCC does not have sqrt function but has sqrtf. Unfortunately an earlier fix to add --int-long-reent for https://github.com/DeqingSun/ch55xduino/issues/107 did not deal with library properly. So there will be an link error.

I'll fix the issue later.

DeqingSun commented 1 year ago

Please try sqrtf in 0.0.18

ZerooNight commented 1 year ago

HI thanks for the update but it seems that any code are not working in 0.0.18 the comport doesn't show after burn

take a look at the pic below i wrote a simple test after update to 0.0.18,the usage of program space reduce a lot 0.0.18 use 2379 0.0.17 use 9208 552-1 552-2

DeqingSun commented 1 year ago

Sorry I just realized there was a compiler problem in Windows. If you have a Mac or Linux it would work. I'm still investigating the reason

DeqingSun commented 1 year ago

The 0.0.18 has been rolled backed to an earlier compiler built with updated library. Please remove the package and add again.

ZerooNight commented 1 year ago

image works fine now! thank you very much