Giter VIP home page Giter VIP logo

Comments (5)

pasko-zh avatar pasko-zh commented on July 4, 2024

Hi Max,

Thanks for your support... I am not the GCC expert, so, let me investigate it...

from brzo_i2c.

beefeater94 avatar beefeater94 commented on July 4, 2024

I think the compiler is just running out of registers. ASM blocks in read() and write() use 14 registers. Even with the old compiler, I got the RL_REGS error when I tried to add a 15th. The best fix is to rewrite assembly with fewer registers. For example, error and repeated-start flags can be in RAM without slowing the execution.

from brzo_i2c.

pasko-zh avatar pasko-zh commented on July 4, 2024

@beefeater94 : Well, the point is not that I do not understand what the compiler is saying, i.e. no more registers. However, the question is why this version of GCC behaves differently and which compiler flags cause thise different behaviour compared to older versions. Thus, changing flags comes before changing code ;-)

from brzo_i2c.

JimDrewGH avatar JimDrewGH commented on July 4, 2024

You should be able to just save and restore registers in the assembly code and it would not matter how many registers you use as long as the code was single threaded (ie. save registers - run code - restore registers - exit). I have no idea why a compiler would care about register usage - but I am an assembly guy, not a high level language user.

from brzo_i2c.

pasko-zh avatar pasko-zh commented on July 4, 2024

@JimDrewGH Well, with inline assembly you can either choose registers to be used yourself, or you can let the compiler choose them, see here. I have used the latter method.

from brzo_i2c.

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.