Program stuck at certain line in fractional calculation

I am trying to read from a delay line using interpolation. So therefore I need to get the fractional part of my index (floating point). I’m using this function:

float fractional(float in) {
    long long in_i = in;
    float in_f = in_i;
    float out = in - in_f;
    return out;

This calculation works on its own. But when I implement it in my delay read function, it somehow gets stuck at line 2 (converting back to float). I am using the debugger in Arduino IDE. Here are some screenshots to show what the debugger is showing.

Line 1 is going fine.

At line 2 it calls some weird function (see call stack).

Program counter still moving, buts keeps calling more functions.

And it just never arrives at line 3.

Anybody got any idea on what’s going on?

I discovered the problem lies somewhere else in my program. Feedback related. Code works as expected when I remove a certain feedback path.

1 Like

I’m sorry I couldn’t respond to you when you posted this, but I’m glad to hear that it’s working now, Jason :slight_smile:

Thanks anyway.
The problem I experienced was that I just didn’t get any audio after some new upload cycles. Got it several times again after I thought I solved it. I tried to track the problem down by place “return 0.f” at different places in certain function. But when I thought I had it, it would happen again later on.

Also experienced that my while loop in Main was getting slow (noticed through my LEDs getting updated slower).

And had the impression that analogRead() in Arduino was kinda slow too.

So all this made me decide to go back to the VScode environment. Everything works as expected now.

(The reason I tried out the Arduino environment was because of the Arduino hardware pwm functionality (PWM frequencies at audio sampling rate). As this is not yet implemented in libDaisy, I’m going to use external SPI dac’s now)

We hope to complete & merge the PWM branch very soon!

1 Like