lvgl / lv_demos

Examples, tutorials and applications for the LVGL embedded GUI library

Home Page:https://lvgl.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lv_demo_benchmark causes floating point exception

higaski opened this issue · comments

The function rnd_next in the lv_demo_benchmark causes a floating point exception in line 1007 in case both input arguments are equal.

static int32_t rnd_next(int32_t min, int32_t max)
{
    if(min > max) {
        int32_t t = min;
        min = max;
        max = t;
    }

    int32_t d = max - min;
    int32_t r = (rnd_map[rnd_act] % d) + min;  // Exception here

    rnd_act++;
    if(rnd_act >= RND_NUM) rnd_act = 0;

    return r;

}

This case is handles here:

if(min == max)
return min;

Oh I'm sorry, I was still checking out v8.0.1... silly me.