Git Product home page Git Product logo

Comments (6)

softegg avatar softegg commented on August 20, 2024

I made a fix and submitted pull request #27.
#27

from bounce2.

thomasfredericks avatar thomasfredericks commented on August 20, 2024

Where is the _BV macro defined? Is this only with the Due? Are you using Arduino.cc or Arduino.org?

from bounce2.

PaulStoffregen avatar PaulStoffregen commented on August 20, 2024

_BV() has been so widely used in Arduino code for so long, I had always assumed it was part of the Arduino code library. But looking into this, it turns out to be part of avr-libc.

http://www.nongnu.org/avr-libc/user-manual/group__avr__sfr.html

Perhaps a simpler patch might look like:

#ifndef _BV
#define _BV(n) (1<<(n))
#endif

from bounce2.

softegg avatar softegg commented on August 20, 2024

It builds on the Arduino Mega 2560. I'm guessing a problem with non AVR cores, based on Paul's comment.
I'm running Arduino 1.6.6. The "About Arduino" references Arduino.cc .
I chose to replace every "_BV" with "bit" because "bit" is actually in Arduino.h, so presumably that is the party approved solution for Arduino.
Personally, I think typing out the bit shift code explicitly (1<<bits) is preferable, because nobody has to guess what it does, and it's about the same number of characters. I can't see any advantage to making a macro of this. But since it was done, I'm trying to stick with the system.

from bounce2.

thomasfredericks avatar thomasfredericks commented on August 20, 2024

I will add Paul's patch as it is the minimum of modification required to fix this.

from bounce2.

HamishB avatar HamishB commented on August 20, 2024

FYI this was also a problem with Cortex M0 SAMD21 (used by Arduino Zero and others like the Adafruit Feather M0 boards). With the patch it builds fine.

regards,
Hamish

from bounce2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.