awonak / europigo Goto Github PK
View Code? Open in Web Editor NEWAlternate firmware for the Allen Synthesis EuroPi written in Go
License: MIT License
Alternate firmware for the Allen Synthesis EuroPi written in Go
License: MIT License
Hey Adam! Been looking a bit through the code and I thought to take note of some things that called out to me.
EuroPi struct needs better naming or documentation. I'd guess K1
and K2
are the knobs, but it is hard to be sure. Adding a comment or changing them to Knob1
and Knob2
would be pretty good (I'd opt for the second since it would make comments superfluous, which is an especially good thing!). Same goes for NewAI
and NewDI
functions, their naming seems evil to me hahah ๐
I feel like you should be making better use of the tinygo drivers package and it's interfaces. A lot of stuff here has wrappers that feel superfluous to me. An example is the Display. Instead of having a *Display
in the EuroPi struct could you not use a drivers.Displayer
and have the font stored in the EuroPi
struct too if needed?
I also feel like the DigitalReader
could be a struct instead of an interface. Though this would prevent mocking (never mocked tinygo programs myself though).
After some thinking... Shouldn't all of Europi's fields be non-interface types? What exactly is the advantage of having them as interface types? Seems to me they should be at most structs that embed interfaces which implement the IO functionality.
yep, I think strconv.Itoa
is causing those awful heap alloc. Instead I'd have a static byte array of the size of the display and use the strconv.AppendInt
function to avoid heap allocations altogether.
type display struct {
// ...
buf [16]byte
}
// ...
n := copy(disp.buf[:], "my knob is at ")
strconv.AppendInt(a[:n:16], number, 10) // if append exceeds capacity then you have a problem
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.