Giter VIP home page Giter VIP logo

Comments (7)

enjoy-digital avatar enjoy-digital commented on August 19, 2024

fixed via db3ef55

I don't know why console.getkey() was waiting for return on Linux machines...

Now tested on Linux/Windows. Feel free to eventually cleanup getkey function for Linux, this is a copy/past from stackoverflow.

from misoc.

sbourdeauducq avatar sbourdeauducq commented on August 19, 2024

Thanks for the quick fix. But can you please commit only clean code to misoc? The termios calls can be done only once at startup/termination of the program (as the C flterm did). The character function can also be removed and replaced with e.g. self.serial.read().decode().

from misoc.

enjoy-digital avatar enjoy-digital commented on August 19, 2024

I only tried to help you figuring out what was wrong (different behaviour of console.getkey() between machines). Thanks for your comment, I'm aware this is dirty, I'll see if I can improve that when I'll have more time for this.

from misoc.

sbourdeauducq avatar sbourdeauducq commented on August 19, 2024

After reviewing flterm a bit more, I found many other problems (see IRC log). I could fix them myself, but I would like you to do it as an exercise and learn about e.g. Python's bytes and str. When you propose or commit code like this without being careful (I am convinced that this is carelessness or laziness, as you seem very capable), the code quality of Migen/MiSoC definitely suffers as I cannot catch every single problem when reviewing.

You probably have much insight yourself into where the issues are. For example, I'm pretty sure you did not really understand Python's bytes when pyserial returned you some, and you did not want to learn about them, so instead you hacked together messy/buggy code, did some cursory testing and called it a day. Please make the effort to understand how your program works in detail and write proper code, as myself and other contributors to migen/misoc/artiq do.

from misoc.

enjoy-digital avatar enjoy-digital commented on August 19, 2024

I just did a first cleanup pass. There is still the getkey functions(termios) and threads to cleanup. If you still see problems around bytes/str, can you report it to me?

from misoc.

sbourdeauducq avatar sbourdeauducq commented on August 19, 2024

Much better, thanks!
I don't actually understand how the thread starting/stopping is supposed to work but (1) threads are generally awful in Python in ways that often cannot be fixed (2) we will replace this part of the code when switching pyserial to asyncio. So the current solution is okay-ish.

from misoc.

enjoy-digital avatar enjoy-digital commented on August 19, 2024

Thanks for the comments, I did another cleanup. OK for the threads. I'll look at termios later.

from misoc.

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.