Giter Club home page Giter Club logo

Comments (3)

hexagon5un avatar hexagon5un commented on June 8, 2024

I won't lie -- I'm not happy with the make/build system for the code in the book. There are two competing tensions: a) it's nice to have each chapter's code self-contained and b) it creates a lot of redundancy to have each chapter self-contained.

There's also an existing gotcha -- because of the way the CPU speed is incorporated in the Makefiles, it needs a "make distclean" when it's changed or else the already-compiled USART.o will come in with the wrong speed. But because you can always pass F_CPU as a command-line option, I don't know an ironclad way around this except to recompile everything all of the time, which is probably the right thing to do.

F_CPU aside, I think the Makefile is the same (or varies in the .c filename, which is autodetected from the directory name) anyway. This probably makes the Makefile.inc idea even more reasonable -- toss that in the library folder and be done with it.

And because of that fact, I think it'd be very easy to restructure the way you're thinking. Or maybe split the makefile up into a programming-logic section and a flash-programming section, leaving the main defines (chip, CPU, baud) in each directory?

Have at it and submit a pull request! I'll open up a development branch and hack away as well. I'm going on vacation for a couple weeks, but will have time to review stuff afterwards.

Thanks!

from avr-programming.

adicarlo avatar adicarlo commented on June 8, 2024

hexagon5un writes:

I won't lie -- I'm not happy with the make/build system for the code
in the book. There are two competing tensions: a) it's nice to have
each chapter's code self-contained and b) it creates a lot of
redundancy to have each chapter self-contained.

Totally understand, and that's why I wanted to know if the work was
welcome before embarking on it.

There's also an existing gotcha -- because of the way the CPU speed is
incorporated in the Makefiles, it needs a "make distclean" when it's
changed or else the already-compiled USART.o will come in with the
wrong speed. But because you can always pass F_CPU as a command-line
option, I don't know an ironclad way around this except to recompile
everything all of the time, which is probably the right thing to do.

Well, its pretty conventional with C makefiles that if you change
CFLAGS, you're going to have to 'make clean' to get good results.
So I wouldn't stress too much over this one.

F_CPU aside, I think the Makefile is the same (or varies in the .c
filename, which is autodetected from the directory name) anyway. This
probably makes the Makefile.inc idea even more reasonable -- toss that
in the library folder and be done with it.

And because of that fact, I think it'd be very easy to restructure the
way you're thinking. Or maybe split the makefile up into a
programming-logic section and a flash-programming section, leaving the
main defines (chip, CPU, baud) in each directory?

Have at it and submit a pull request! I'll open up a development
branch and hack away as well. I'm going on vacation for a couple
weeks, but will have time to review stuff afterwards.

Ok, great. I'll try to work out something that seems natural. I'm hearing
that you'd prefer per-directory configuration of basics (baud and CPU etc),
no objections there.

Does it make sense to assign this ticket to me?

from avr-programming.

adicarlo avatar adicarlo commented on June 8, 2024

Pull request is in!

from avr-programming.

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.