Teensy 3.6 error ATOMIC_BLOCK(ATOMIC_RESTORESTATE)

Issue #83 closed
TurBoss
created an issue

Hello,

just found this when trying to compile the SR or I2C examples in a teensy 3.6 board

/home/turboss/Arduino/libraries/new-liquidcrystal/FastIO.cpp: In function 'void fio_shiftOut(fio_register, fio_bit, fio_register, fio_bit, uint8_t, uint8_t)':
/home/turboss/Arduino/libraries/new-liquidcrystal/FastIO.cpp:109:36: error: expected primary-expression before ')' token
    ATOMIC_BLOCK(ATOMIC_RESTORESTATE)

                                    ^
/home/turboss/Arduino/libraries/new-liquidcrystal/FastIO.cpp:107:9: warning: unused variable 'i' [-Wunused-variable]
  int8_t i;

         ^
/home/turboss/Arduino/libraries/new-liquidcrystal/FastIO.cpp: In function 'void fio_shiftOut(fio_register, uint8_t, fio_register, uint8_t)':
/home/turboss/Arduino/libraries/new-liquidcrystal/FastIO.cpp:132:36: error: expected primary-expression before ')' token
    ATOMIC_BLOCK(ATOMIC_RESTORESTATE)

                                    ^
/home/turboss/Arduino/libraries/new-liquidcrystal/FastIO.cpp: In function 'void fio_shiftOut1(fio_register, fio_bit, uint8_t, boolean)':
/home/turboss/Arduino/libraries/new-liquidcrystal/FastIO.cpp:182:42: error: expected primary-expression before ')' token
          ATOMIC_BLOCK(ATOMIC_RESTORESTATE)

                                          ^
/home/turboss/Arduino/libraries/new-liquidcrystal/FastIO.cpp:194:42: error: expected primary-expression before ')' token
          ATOMIC_BLOCK(ATOMIC_RESTORESTATE)

                                          ^
/home/turboss/Arduino/libraries/new-liquidcrystal/FastIO.cpp:213:39: error: expected primary-expression before ')' token
       ATOMIC_BLOCK(ATOMIC_RESTORESTATE)

                                       ^
/home/turboss/Arduino/libraries/new-liquidcrystal/FastIO.cpp:220:39: error: expected primary-expression before ')' token
       ATOMIC_BLOCK(ATOMIC_RESTORESTATE)

                                       ^

Comments (6)

  1. Francisco Malpartida repo owner

    This error doesn't make much sense. The teensy board is not an AVR architecture. Therefore the definition of the ATOMIC_BLOCK and ATOMIC_RESTORESTATE is given by what is in fastIO.h:

    #define FIO_FALLBACK
    #define ATOMIC_BLOCK(dummy) if(true)
    #define ATOMIC_RESTORESTATE
    typedef uint8_t fio_bit;
    typedef uint8_t fio_register;
    

    Where expressions such as:

    ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
    {
       \\ Do something
    }
    

    Should be equivalent to:

    if (true)
    {
       \\ Do something
    }
    

    Are you using the version in the integration branch?

  2. TurBoss reporter

    hello,

    I have changed to the integration branch and only this error is shown now

    /home/turboss/Arduino/libraries/new-liquidcrystal/I2CIO.cpp: In member function 'int I2CIO::digitalWrite(uint8_t, uint8_t)':
    /home/turboss/Arduino/libraries/new-liquidcrystal/I2CIO.cpp:201:19: error: 'value' was not declared in this scope
           _shadow = ( value | _dirMask );
                       ^
    

    Thank you

    edit: Arduino 1.8.5 teensyduino 1.4.0

  3. Log in to comment