Code Monkey home page Code Monkey logo

Comments (7)

stefanrueger avatar stefanrueger commented on August 14, 2024 1

even the CLI might have a use for it: in terminal mode

AVRDUDE only ever considers one part/programmer combo in each incarnation; once that's fixed -A either makes sense or not, but it wouldn't be required (or, in my understanding, make sense) to toggle that option back and forth.

from avrdude.

stefanrueger avatar stefanrueger commented on August 14, 2024 1

[global, access functions or context pointer]

As a quick shot I'd make this option global in the first instance, and then at some point change to context pointer for all global variables.

from avrdude.

dl8dtl avatar dl8dtl commented on August 14, 2024

Also, what I don't understand, from my protocol:

2024-03-30T09:55:55 Read 8666  bytes
2024-03-30T09:56:05 Wrote 16384 bytes to /home/joerg/src/avrdude/foo.hex

It clearly optimized the trailing 0xFF when reading (through avr_read_mem(), as can be seen from the 8666 bytes. Yet, when writing the memory buffer through fileio(), the entire memory region is saved. The code suggests to me that only the "relevant" bytes ought to be written.

from avrdude.

dl8dtl avatar dl8dtl commented on August 14, 2024

OK, I understand the latter:

  if(size < 0 || op == FIO_READ || op == FIO_READ_FOR_VERIFY)
    size = mem->size;

So the upper layer is supposed to track the size.

from avrdude.

stefanrueger avatar stefanrueger commented on August 14, 2024

There is no way to turn it on again? This is not good.

I agree. AVRDUDE doesn't need to switch -A off again, but a library might want to. I suggest to make the -A flag a global variable that can be accessed by the library.

-A is meant to not remove trailing 0xff sequences from avr_reads() or file input, as they could be relevant data and the programmer could see AVR flash as normal memory (as certain bootloaders do or AVR with page erase) rather than NOR memory.

from avrdude.

dl8dtl avatar dl8dtl commented on August 14, 2024

Global variable sounds OK to me.
Other users of the library might turn -A into their own option system.
Btw. even the CLI might have a use for it: in terminal mode.

from avrdude.

dl8dtl avatar dl8dtl commented on August 14, 2024

Rather than making the variable global, it could remain static (module-internal, not exposed in the library). That enforces the use of access functions.
A completely different option would be a kind of library context structure that holds all that kind of options (also verbose, and quell_progress). It could start out as a global, and eventually moved as a pointer into API calls – that could even make the library API reentrant. :-)

from avrdude.

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.