Shop OBEX P1 Docs P2 Docs Learn Events
spin2cpp multiple {++ volatile} dat sections error — Parallax Forums

spin2cpp multiple {++ volatile} dat sections error

SRLMSRLM Posts: 5,045
edited 2013-06-29 11:54 in Propeller 1
When I convert the following spin file:
...

Dat {++ volatile}

Power
RightPower    word      0
LeftPower     word      0

...

Dat {++ volatile}
              org
Entry
              mov       dira, OutputMask        ' set outputs
              mov       ctra, CTRA_Setting
              mov       ctrb, CTRB_Setting
              mov       frqa, #1                ' frq is added to phs every clock cycle
              mov       frqb, #1                ' so it takes -phs clockcycles to generate a falling edge
...

I get the following in the .h file:
static uint8_t  volatile  volatile dat[];

Which produces
In file included from eddie_motor_driver.cpp:8:0:
eddie_motor_driver.h:25:3: error: duplicate 'volatile'
eddie_motor_driver.cpp:19:1: error: duplicate 'volatile'

I'm using spin2cpp version 1.04 from the propgcc version alpha_v1_9_0_2042 on Ubuntu 13.04.

Comments

  • ersmithersmith Posts: 6,054
    edited 2013-06-29 11:54
    The DAT sections are all merged, so if any one has {++volatile} on it they will all be volatile. So you only need that declaration once.

    That said, spin2cpp should handle the multiple declarations, so thanks for the bug report.

    Eric
Sign In or Register to comment.