C error: expression must have a constant value

后端 未结 3 1979
逝去的感伤
逝去的感伤 2020-12-11 20:01

I am writing some embedded code to interface with an external device over SPI. The device has several registers of varying length and to help keep things straight I have def

3条回答
  •  情书的邮戳
    2020-12-11 20:56

    const doesn't make them constants at compile time. Make them #defines and the compiler will be happy.

提交回复
热议问题