Arduino due does not compile

Issue #45 resolved
artur mudrykh
created an issue

provides just such an error:

C:\Users\artur_000\Desktop\arduino-1.5.6-r2\libraries\LiquidCrystal\FastIO.cpp: In function 'void fio_shiftOut1(fio_register, fio_bit, uint8_t, boolean)': C:\Users\artur_000\Desktop\arduino-1.5.6-r2\libraries\LiquidCrystal\FastIO.cpp:214: error: '_BV' was not declared in this scope

Comments (38)

  1. Francisco Malpartida repo owner

    Close #45 Added _BV macro to LCD.h, this macro is normally defined by Atmel in its library. The macro is very dependent from Atmel.

    REMARK: This fix will not fix being able to compile this library as the Arduino IDE has broken a range of base support operation on the DUE. For example: digitalPinToTimer()

    This library has not even been ported nor tested with Arduino 1.5

    → <<cset c0432608719b>>

  2. Francisco Malpartida repo owner

    Perhaps you can convince the Arduino team to fix some of the things that they have broken.

    In any case, give the fix a shot you might be able to get away with it as not all the Arduino broken calls are used in all the driver modes.

  3. artur mudrykh reporter

    that's what was offered, developers Arduino.

    Oh, right, it's from a separate LiquidCrystal library, you sortof mentioned that.

    We could fix this by exposing the _BV macro on the Due, but personally I think this macro is really ugly and we should recommend people to just use (1 << foo) instead. Not sure what the best approach is, here.

    @artur mudrykh, perhaps you could suggest to the LiquidCrystal developer to use this (1 << foo) syntax for maximum compatibility. ALternatively, to solve your problem right now, you could put #define _BV(x) (1 << (x)) near the top of FastIO.cpp.

  4. Francisco Malpartida repo owner

    This is precisely what I have done on the latest commit. However, I've added the change to LCD.h. The macro, will be defined if it isn't available. There are several places in the code where it is used: 1. FastIO.cpp 2. SR1W implementation. 3. Several examples.

    You can get the latest commit and try it out.

  5. artur mudrykh reporter

    HelloWorld_i2s not compiled. provides just such an error:

    C:\Users\artur_000\Desktop\arduino-1.5.6-r2\libraries\LiquidCrystal\FastIO.cpp: In function 'void fio_shiftOut1(fio_register, fio_bit, uint8_t, boolean)':
    C:\Users\artur_000\Desktop\arduino-1.5.6-r2\libraries\LiquidCrystal\FastIO.cpp:215: error: '_BV' was not declared in this scope
    
  6. Francisco Malpartida repo owner

    Can you see this bit of code in your downloaded file?

    /*!
     @defined 
     @abstract   Performs a bitwise shift.
     @discussion Defines _BV bit shift which is very dependent macro defined by
     Atmel.
    
        \note The bit shift is performed by the compiler which then inserts the
        result into the code. Thus, there is no run-time overhead when using
        _BV().
    */
    #ifndef _BV    
    #define _BV(bit) (1 << (bit))
    #endif
    

    If you can't you haven't downloaded it from the repository. In any case, insert this piece of code into the LCD.h file and it should get you through the compilation.

  7. artur mudrykh reporter

    added to fastIO.h code. Now a new error during compilation HelloWorld_i2c.

    Arduino: 1.5.6-r2 (Windows 7), Board: "Arduino Due (Programming Port)"
    
    C:\Users\arturmon\Desktop\arduino-1.5.6-r2\libraries\LiquidCrystal\LiquidCrystal.cpp: In member function 'virtual void LiquidCrystal::setBacklight(uint8_t)':
    C:\Users\arturmon\Desktop\arduino-1.5.6-r2\libraries\LiquidCrystal\LiquidCrystal.cpp:173: error: expected primary-expression before ')' token
    
      This report would have more information with
      "Show verbose output during compilation"
      enabled in File > Preferences.
    
  8. Francisco Malpartida repo owner

    This is another porting issue of the Due: digitalPinToTimer(_backlightPin) != NOT_ON_TIMER

    digitalPinToTimer or the constant NOT_ON_TIMER don't look to be supported. As I mentioned, to get this library to work with the Due and release 1.5.6 is going to take a bit of time.

    As soon as I clear up some commitments I will try to get this going.

    As a workaround to keep compiling, you can remove the function setBacklight and any references to it.

  9. Island Ingenuity

    I am having the same issue, we are using a DUE for our Capstone Project and would love to use this library with our I2C LCD screens. We appreciate you looking into the problem and are more than happy to test it aswell.

  10. Phạm Minh Đức

    I have the same problem like that LiquidCrystal\FastIO.cpp: In function 'void fio_shiftOut1(fio_register, fio_bit, uint8_t, boolean)': FastIO.cpp:214:19: error: '_BV' was not declared in this scope if(value & _BV(i)) ^ Error compiling.

    Could you please having me fix thí problem. I am using Arduino DUE and is it a hardware problem

  11. Francisco Malpartida repo owner

    Please do as suggested, download the code from the latest repo commit. You will have to remove the setBacklight for the due till either the Arduino team fixes back compatibility or I have time for a workaround.

  12. milliampere

    I have just downloaded the library and I am getting the same error with due and Arduino 1.6.5. Whats the actual status of this error and the New LiquidCrystal library? Desperately looking forward to something working better than the standard ... Thanks!

  13. milliampere

    Sorry for very late response, I was travelling. Latest version 1.3.2 compiles with DUE with same error:

    C:\Daten\Henning\Werkstatt\Arduino\libraries\NewliquidCrystal\FastIO.cpp: In function 'void fio_shiftOut1(fio_register, fio_bit, uint8_t, boolean)': C:\Daten\Henning\Werkstatt\Arduino\libraries\NewliquidCrystal\FastIO.cpp:214 :19: error: '_BV' was not declared in this scope if(value & _BV(i)) ^ Fehler beim Kompilieren.

    I used the HelloWorld4bit example code that comes with the library Henning


    Gesendet: Sonntag, 20. September 2015 13:50 An: henningkal@t-online.de Betreff: Re: [Bitbucket] Issue #45: Arduino due does not compile (fmalpartida/new-liquidcrystal)

    fmalpartida https://avatar-cdn.atlassian.com/08edf93b907b9075d116e1fe38a82420?s=32

    F Malpartida commented on issue #45:
    Arduino https://bitbucket.org/fmalpartida/new-liquidcrystal/issues/45/arduino-due-d oes-not-compile due does not compile

    Please try and see in in the Due the bit bang version no longer causes a compilation error.

    View https://bitbucket.org/fmalpartida/new-liquidcrystal/issues/45/arduino-due-d oes-not-compile this issue or add a comment by replying to this email.

    Unwatch https://bitbucket.org/api/1.0/fmalpartida/new-liquidcrystal/issue/45/unwatc h/milliampere/718fce697832d976906dd8d5d93230afb0b228ae/ this issue to stop receiving email updates. https://bitbucket.org/account/notifications/mark-read/203087401/39da810916a 63b7005bdb809a90f406bd439ee5e/ https://bitbucket.org Bitbucket

  14. milliampere

    With 1.3.3 I get a rather long list of errors. See screenshot attached. For a strange reason I cannot copy this compile output into an email, Outlook crashes with this text. Henning


    Gesendet: Samstag, 3. Oktober 2015 19:02 An: henningkal@t-online.de Betreff: Re: [Bitbucket] Issue #45: Arduino due does not compile (fmalpartida/new-liquidcrystal)

    fmalpartida https://avatar-cdn.atlassian.com/08edf93b907b9075d116e1fe38a82420?s=32

    F Malpartida commented on issue #45:
    Arduino https://bitbucket.org/fmalpartida/new-liquidcrystal/issues/45/arduino-due-d oes-not-compile due does not compile

    Updated and pushed version: 1.3.3

    Status: open resolved

    View https://bitbucket.org/fmalpartida/new-liquidcrystal/issues/45/arduino-due-d oes-not-compile this issue or add a comment by replying to this email.

    Unwatch https://bitbucket.org/api/1.0/fmalpartida/new-liquidcrystal/issue/45/unwatc h/milliampere/718fce697832d976906dd8d5d93230afb0b228ae/ this issue to stop receiving email updates. https://bitbucket.org/account/notifications/mark-read/209038991/b88fa801f99 db7409bca9b0be66ece39bdf190ee/ https://bitbucket.org Bitbucket

  15. milliampere

    Understood, thanks anyway !!!


    Gesendet: Sonntag, 4. Oktober 2015 15:07 An: henningkal@t-online.de Betreff: Re: [Bitbucket] Issue #45: Arduino due does not compile (fmalpartida/new-liquidcrystal)

    fmalpartida https://avatar-cdn.atlassian.com/08edf93b907b9075d116e1fe38a82420?s=32

    F Malpartida commented on issue #45:
    Arduino https://bitbucket.org/fmalpartida/new-liquidcrystal/issues/45/arduino-due-d oes-not-compile due does not compile

    I give up on the due for the time being. I don't own a Due and it is very difficult for me to get this fixed and tested.

    I will give it a shot at some point or if any one would like to send me a fix I will be more than happy to pull it in.

    Assignee: fmalpartida
    Component: New Liquid Crystal Library
    Description:

    provides just such an error:

    C:\Users\artur_000\Desktop\arduino-1.5.6-r2\libraries\LiquidCrystal\FastIO.c pp: In function 'void fio_shiftOut1(fio_register, fio_bit, uint8_t, boolean)': C:\Users\artur_000\Desktop\arduino-1.5.6-r2\libraries\LiquidCrystal\FastIO.c pp:214: error: '_BV' was not declared in this scope

    provides just such an error:

    C:\Users\artur_000\Desktop\arduino-1.5.6-r2\libraries\LiquidCrystal\FastIO.c pp: In function 'void fio_shiftOut1(fio_register, fio_bit, uint8_t, boolean)': C:\Users\artur_000\Desktop\arduino-1.5.6-r2\libraries\LiquidCrystal\FastIO.c pp:214: error: '_BV' was not declared in this scope

    View https://bitbucket.org/fmalpartida/new-liquidcrystal/issues/45/arduino-due-d oes-not-compile this issue or add a comment by replying to this email.

    Unwatch https://bitbucket.org/api/1.0/fmalpartida/new-liquidcrystal/issue/45/unwatc h/milliampere/718fce697832d976906dd8d5d93230afb0b228ae/ this issue to stop receiving email updates. https://bitbucket.org/account/notifications/mark-read/209103793/44f93a16097 f1f7d69e1d99ee5b1261317a6abb0/ https://bitbucket.org Bitbucket

  16. Log in to comment