Git Product home page Git Product logo

esp32-i2c-eeprom's Introduction

Hey there, I'm Zachary Vincze.

I'm currently a student studying computer science at the University of Toronto.


Check out some stuff I'm working on here. Or, if you're interested give my website a look for some more detailed devlogs on what I'm currently working on.


Interests

  • Systems related programming
  • Emulation development
  • Game development (or rather, game engine development)
  • Breaking things (and putting them back together, mostly)

I like to keep things as low-level as I can.

esp32-i2c-eeprom's People

Contributors

zacharyvincze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

esp32-i2c-eeprom's Issues

i2c_master_write_byte(cmd, eeaddress<<8, 1)

I saw your rep.

uint8_t eeprom_read_byte(uint8_t deviceaddress, uint16_t eeaddress) {
    i2c_cmd_handle_t cmd = i2c_cmd_link_create();
    i2c_master_start(cmd);
    i2c_master_write_byte(cmd, (deviceaddress<<1)|EEPROM_WRITE_ADDR, 1);
    i2c_master_write_byte(cmd, eeaddress<<8, 1);  --> *1
    i2c_master_write_byte(cmd, eeaddress&0xFF, 1);
    i2c_master_start(cmd);
    i2c_master_write_byte(cmd, (deviceaddress<<1)|EEPROM_READ_ADDR, 1);

    uint8_t data;
    i2c_master_read_byte(cmd, &data, 1);
    i2c_master_stop(cmd);
    i2c_master_cmd_begin(I2C_NUM_1, cmd, 1000/portTICK_PERIOD_MS);
    i2c_cmd_link_delete(cmd);
    return data;
}

*1
i2c_master_write_byte(cmd, eeaddress>>8, 1);

Please confirm.

i2c is not closed properly in eeprom_write

in function eeprom_write() the i2c is not closed at if condition.
if (bytes_remaining <= first_write_size) {
i2c_master_write(cmd, data, bytes_remaining, 1);
}

recomended fix :
if (bytes_remaining <= first_write_size) {
i2c_master_write(cmd, data, bytes_remaining, 1);
i2c_master_stop(cmd);
ret = i2c_master_cmd_begin(I2C_NUM_1, cmd, 1000/portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);
if (ret != ESP_OK) return ret;
}

No License provided

Which license applies for this work?
If no license is given, noone has any rights to use it.

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.