Giter VIP home page Giter VIP logo

Comments (4)

david-sawatzke avatar david-sawatzke commented on August 23, 2024

I've already started #27, which takes a bit different, but similar approach. I personally prefer the approach with an universal Unused pin implementing all the AF traits, but both approaches are (mostly) equivalent. It's doesn't seem hard to modify it.

from stm32f0xx-hal.

therealprof avatar therealprof commented on August 23, 2024

@david-sawatzke

I personally prefer the approach with an universal Unused pin implementing all the AF traits, but both approaches are (mostly) equivalent.

Uhm, that's not what your implementation does. I basically just defines an empty shell without any functionality (not even sure why you're using a PhantomData).

from stm32f0xx-hal.

david-sawatzke avatar david-sawatzke commented on August 23, 2024

With AF traits i meant the traits that implement the link from af to peripheral, eg TxPin.

I used PhantomData because I wasn't sure if we maybe need to extend it in the future and without it it's constructable by user code (afaik).

from stm32f0xx-hal.

therealprof avatar therealprof commented on August 23, 2024

I used PhantomData because I wasn't sure if we maybe need to extend it in the future

😲

and without it it's constructable by user code (afaik).

In that case you could use

pub struct Unused {
    _0: (),
}

However it doesn't really matter since it's really just an empty shell and there's exactly none functionality attached to it (and true to the meaning never should be...).

from stm32f0xx-hal.

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.