Giter Site home page Giter Site logo

Comments (4)

horsemann07 avatar horsemann07 commented on May 20, 2024 1

Hello @UncleRus

Thanks for the advice and guidance.

The first time, I m trying to contribute to the open-source repo, I m not well known about coding standards and other things.
I will update lib as per the coding standard and your instructions.

Thanks!

from esp-idf-lib.

horsemann07 avatar horsemann07 commented on May 20, 2024

Hello, @kusumy @UncleRus

I tried to port the driver code of Dallas DS243. Here is the link,
I do not have the device so not tested the code on the device if anyone has can test and update me.
If it works I will try to create the merge request.
It's building successfully on esp idf v4.4.1.

Thanks.

from esp-idf-lib.

UncleRus avatar UncleRus commented on May 20, 2024

Hi @Raghav3107 !
First of all, thank you.

  1. The first and most important note: drivers must be stateless! If you need to save some state between calls, the device descriptor structure is used. Your library can only be used with single device, because of the saving device GPIO and mode to internal _pin and _mode variables. The same goes for the ds2438_update() function: it should just read and return the voltage and temperature values without saving them. To avoid this, declare device descriptor struct and pass it by pointer to all functions.
  2. Please avoid int parameters when they can be replaced with enums.
  3. Please add C++ guards in header.
  4. Move internal definitions such as register numbers from the header to the source. They are only used internally and pollutes the global namespace in header.
  5. Clean includes in header. Why is there stdio.h and stdlib.h?
  6. Avoid using of func(void) instead of func().
  7. Do not use tabs. Spaces only.

from esp-idf-lib.

horsemann07 avatar horsemann07 commented on May 20, 2024

Hello @UncleRus.

I updated the repository as per your instruction.
Can you please check it once again?

Thanks!

from esp-idf-lib.

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.