Comments (5)
Hi Max,
Thanks for your support... I am not the GCC expert, so, let me investigate it...
from brzo_i2c.
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.
@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.
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.
@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)
- I2C stucks after clock stretching time exceeds HOT 25
- Question: Logic Levels and ... HOT 2
- Cannot compile for Heltec Wifi Kit 32 HOT 3
- INA219 HOT 8
- Multiple I2C HOT 2
- gpio_init() will cause I2C bus busy (code: 1) HOT 5
- Migrating ADS1015 from Wire HOT 5
- AM2320 sensor not found HOT 11
- I2C bus handle for multiple instances posibility HOT 1
- Support speeds < 100KHz HOT 2
- after 1 slave fails others stop working HOT 4
- Have you thought about a i2c slave implementation. HOT 2
- Novice obsession HOT 2
- SDA set before SCL while preparing STOP in brzo_i2c_read() HOT 7
- MEMW not always present
- Clock stretch logic
- Arduino IDE compile error with new ESP8266 core 3.0.0 HOT 30
- SCL cock stretching HOT 3
- Platformio installation instructions confusing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brzo_i2c.