Problems Solution is:
were we have to add this to the lokal makefile:
Quote
first point after adding Math lib, it seems the loading sequence of libraries is wrong. the `__errno’ compilation error.
To resolve it we have to set the loading sequence, just change this line in your Makefile:LIBS= to LIBS = -lm -lgcc -lc
ORGINAL PROBLEM POST
Hei.
I have made now, a LFO (UP/DOWN Ramp & Triangle), now i need to add a logaritmic ammount to get CURVES/SINEs on the LFO Straight Lines, i want to do this with a Encoder.
My LFO Values going from 0-65535 (16bit, AOUT-Ready)
My Curve CC also goes from 0-65535 (Curve means Logaritmic)
I have to execute this code every milli seconds, to change the AOUT, and every 75ms to update the SCOPE-Display
I tryd around and this is code is working with stdi0 and math.h, outside of mios: (Working)
#include \<stdio.h\> #include \<math.h\> double cc = 32000; double curve = 64000; int endresult; int main (void) { printf("exponential\_input 0-65535: "); scanf("%lf", &curve); endresult = cc \* (log(curve) / log(cc)); printf (" %d \n", endresult ); return 0; }
now in mios my code it is also working when i fill in fixed values: (WORKING)
//calculate Exponential double lfo = 65000; double curve = 32000; double lfo\_result; lfo\_result = lfo \* (log(curve) / log(lfo)); if(lfo\_result \> 65535) { lfo\_result = 65535;} if(lfo\_result \< 1) { lfo\_result = 0;}
but when i use my arrays instead of this fixed values, i become a error (NOT WORKING)
//calculate Exponential double lfo = aout[channel\_strip].lfo[y]; double curve = aout[channel\_strip].v\_cc[26+(y\*8)]; double lfo\_result; lfo\_result = lfo \* (log(curve) / log(lfo));
i also tryed: (NOT WORKING)
double lfo\_result = aout[channel\_strip].lfo[y] \* ( log(aout[channel\_strip].v\_cc[26+(y\*8)]) / log(aout[channel\_strip].lfo[y]) );
error is: (errno)
Quote
make (im Verzeichnis: /home/triggermatrix/c/Filterbox-V1)
rm -f project.hex
Creating object file for app.c
app.c: In function ‘APP_Init’:
app.c:218:5: warning: pointer targets in passing argument 2 of ‘xTaskCreate’ differ in signedness [-Wpointer-sign]
In file included from app.c:11:0:
/home/triggermatrix/mios32/trunk/FreeRTOS/Source/include/task.h:360:13: note: expected ‘const char * const’ but argument is of type ‘signed char *’
/home/triggermatrix/mios32_toolchain/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/lib/armv7e-m/libm.a(lib_a-w_log.o): In functionlog': w\_log.c:(.text.log+0xb8): undefined reference to__errno’
w_log.c:(.text.log+0xc2): undefined reference to\_\_errno' w\_log.c:(.text.log+0xcc): undefined reference to__errno’
collect2: error: ld returned 1 exit status
Kompilierung fehlgeschlagen.
make: *** [project_build/project.elf] Fehler 1
dont know how to handle this, i need a cc-controlled logaritmic - any ideas?
here a goodie:

