#68 new to sdcc, cant figure out problem

closed
nobody
None
5
2009-12-23
2009-12-23
sumeet verma
No

sir,
i am new to sdcc world, i made a simple program, and the compiler is giving error "initializer element is not constant", pls help me on this. i am attaching the file.

Discussion

  • sumeet verma
    sumeet verma
    2009-12-23

    error 2

     
    Attachments
  • Maarten Brock
    Maarten Brock
    2009-12-23

    • labels: 101550 -->
    • milestone: 100454 -->
    • status: open --> closed
     
  • Maarten Brock
    Maarten Brock
    2009-12-23

    Sumeet,

    sbit mybit=P1_1;

    With this line you're creating a new special function bit with name mybit and you try to assign it the value at port pin P1.1 at compile time. That is impossible. Unlearn the (stupid) Keil notation and think pure C. If you want to rename P1_1 then use a macro.

    Maarten