Details
-
AboutEmbedded Developer with M.S.E.E.
-
Skillsc, c++, c#, VHDL, Verilog, python
-
LocationUnited States
Joined devRant on 12/25/2016
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
No love for the Memistor...er MemrisThor.
-
I could be wrong but that is not a valid unicast MAC address. It needs a zero in most significant bit in the first octet (which is ordered least significant bit first)
29 has this bit set which means it is multicast and is not his MAC address. -
@Fast-Nop ah right you are. I mixed up the rule in my head.
-
@Fast-Nop Shouldn’t that gist contain an aligned attribute or maybe switch to uint32 instead of char[4] to ensure the correct alignment is used? That first char array might not be guaranteed to be placed on a 32-bit aligned address and if not might result in extra pad bytes to be inserted which would likely result in a malformed header.
-
@Loading the majority of the time it is C. But I also get involved from time to time with other languages, usually for testing or providing user level front end tools, webpages, etc. These might involve other languages like C++, C#, python, JavaScript. Coworkers of mine have worked with Java, GoLang, Angular, and some other higher level stuff. But as far as coding for a bare metal micro controller, C and maybe a hint of C++ is what I use.
Knowing some assembly in this field certainly does not hurt but I usually never have to resort to coding something from scratch using it, mainly just to debug what the compiler settings/options produced and determining what has been optimized out. I suppose if you have to ensure ever bit of an algorithm is efficient as possible you might be able to find a solution that outperforms a particular compiler but I have not been in this kind of situation -
Depending on how low you want to go you might want to look into the world of FPGAs and learn VHDL or Verilog. I am an an embedded engineer by profession and work mostly with C. FPGAs are my passion though and love every instance I get to work with them.
-
@arcioneo ??? Your comment is a little confusing and I honestly can’t understand the intent of what you are saying.
I think you either completely misunderstand c macros or what I was talking about. The use-case of the do-while(0) in the context of c function macros (i.e. #defines that take parameters) which are multi-statement is to ensure the macro is treated in all context as a single block statement.
I am not debating over using multi-statement macros, personally I feel they should be and can be avoided in most cases but there may be some reasons why one might want to use them.
Basically what I am getting at is what @Fast-Nop is referring to is 100% correct and isn’t really a matter of debate. If you have a multi statement macro in c then you should be doing this otherwise someone might try to use it in a way that can cause some really hard to debug issues. -
@arcioneo #defines.
This covers the general idea quite well:
https://stackoverflow.com/questions... -
“It’s a modern feature”
*makes every conceivable attempt at using a new language feature even if the cons out-weigh the pros in the given context* -
@Fast-Nop I am generally a “use curly braces everywhere” dev; so the reason why these type of macros existed always mystified me. Makes so much sense now. It’s the only safe way to define a (multi-statement) macro that is to behave syntactically as a function, no other precompiler solution in c provides this. Thanks for the insight.
-
At my old office there was a mail man that always fucking dropped a nasty bomb in our toilet; pretty much every fucking day! I mean fuck! Does this guy not understand the concept of load balancing?!
-
@TafT yeah partial committing using GUIs is a use-case that just seems more natural via a GUI than CLI interactive mode. I like using VS Code’s keybinds for (un)stage / revert selection.
-
I donno, I find GIT GUIs are much better for visualization and handling rebasing. CLI is good for other tasks, just use the right tool for the job.
-
@RantSomeWhere I prefer:
C: You built a horse, it sorta works. But you forgot it doesn’t clean up after itself and is shitting all over the place.
I love C by the way. -
VHDL
Assuming a and b are registers, in a process you can write:
a<=b;
b<=a;
Takes a single clock to perform. Behold the power of concurrency! -
Don’t know why, but I read “congratulate me” in the same tone as Mad Max “witness me!”. Maybe because I know the craziness that ensues. Anyways congrats!
-
7 if ‘+’ is OR operator
3 if ‘+’ is half adder (aka XOR operation)
11 if ‘+’ is half adder with carry bit
...assumed msb is not a sign bit -
Though I believe NAND and NOR flash are popular choices in FPGA programming as well (I was just stating an example of where you can see them in use). The company I work for also has products that store the u-boot bootloader on an EEPROM which I believe is quite common.
-
@neelgeek no EEPROM is still regularly used in industry today. It is still a popular choice in embedded systems that need to store relatively small amounts of data/parameters (think calibration data, production data...though for production data I like the idea of one-time programmable memory). There are other alternatives that certainly may be better for a particular application (FRAM is really cool replacement) but EEPROM is still a go to for most.
Ever hear of an FPGA? These are very commonly programmed by an EEPROM that contains the bit-file that sets up the logic cells. -
@Grundeir not sure if this was sarcasm or not; looks half as secure to me. Having either of the two keys will provide access. To be twice as secure both locks would need to be redundant (go through the same loops)
-
Yeah I can't believe it, the answer seems pretty obvious to me.
The left one will likely suffer from plumbers crack. Maybe some suspenders would help.
And belly rubs would be more problematic, no way a dog would make that sacrifice. Definitely the right is the one they would choose. -
@diadev if Matlab triggers you, I wonder how you feel about Labview.
I am quite fond of them both to be honest, they are great for what they are for but I haven't used Matlab for years. I still have an occasional run with Labview to build up test routines for production HW testing -
Will this help me make a valid statement by smashing my head on the keyboard? Looks promising.
-
I don't mind it in general, but I also almost never use it simply because multi-line ternary is typically bad style and I prefer multi line in order to separate the test condition and the statements; this is friendlier for debugging embedded systems, since most (all?) microcontroller debuggers (I am usually developing on bare-metal ARM) don't support nested breakpoints (or conditional breakpoints).
It is quite frustrating to debug for 10 minutes stepping through code to reach a specific point in the code that is in a specific state; I then reach a single line if/else or ternary that I need to break on one of the result, to reach the desired state that I need to debug on. Instead I either have to let the routine get called multiple times (10, 20, sometimes hundreds of iterations) until I see the variable change to what I expect or stop debugging, edit the file to use multi line and start over.
If there's a better way I am all for hearing about it. -
@filthyranter Actituatally, depends on electronics. 0 = ON in an Active LOW logic circuit or OFF for Active HIGH
-
@SZenC did you mean "no carriage return"?
Windows \r\n
Linux \n
Edit: @magnusi got the right idea -
Here's the windows 10 version. It's now a multi purpose message.
- We're #1
- Can't
- F U, I don't give a f$&@ -
I discovered this site last week. I see this as being especially useful for IDEs that have a lot going on.
I dabble with VHDL and I haven't tried it yet, but I noticed they have a profile for Xilinx Vivado which generates a lot of files that one may or may not want to track. Having at least a reasonable starting point for what files and extensions to ignore is nice when you are not entirely sure whether a file is a build output product or an essential file for maintaining the state of your project.
FYI If you use VS Code there is an extension that interfaces with it called gi. -
@klonky unipolar. Add some -1s then we can claim them as bipolar ;)
Both still suggestive of mental illness.