qiyongzhong0 / rt-thread-qled

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

warning: #68-D: integer conversion resulted in a change of sign

shishirong opened this issue · comments

在qled.c里给无符号数赋了负值

//定义的是:
typedef struct
{
    s16 pin;
    u8 mode;
    u8 level;
    u8 idx;
    u8 total;
    s16 cnt;
    u16 ton_ms;
    u16 toff_ms;
    const u16 *datas;
    void (*over_cb)(void);
}qled_data_t;

//使用的时候
qled_datas[idx].idx = -1;

是你的编译器报警告吗? 可以修改为qled_datas[idx].idx = (u8)-1; 以消除警告.

嗯,最好是你这边从源头上改一下,这样rt-thread pkgs --update 方便些。