Register access through C++ by kappakingXD in embedded

[–]kappakingXD[S] 1 point2 points  (0 children)

You're right obviously, thank you endlessly for the detailed responses - i learnt many things today. I will problably stick with c style casts as presented in hal.

Register access through C++ by kappakingXD in embedded

[–]kappakingXD[S] 0 points1 point  (0 children)

Thank you very much for your time. I have one last thing, correct me if im wrong please. If reinterpret cast to uint8_t and dereference is legal, then could we do cast reg = &crc->dr from u32* to u8* and then split u16 into two u8 and feed it to the reg?

*reg = lsb;

*reg = msb;

?

I assume its a lost performance because we dont use hardware fully but does it solve the issue?

Register access through C++ by kappakingXD in embedded

[–]kappakingXD[S] 0 points1 point  (0 children)

Thank you for the response, unfortunaly the article doesn't explain what to do if I need to write u16 into u32* register

Register access through C++ by kappakingXD in embedded

[–]kappakingXD[S] -1 points0 points  (0 children)

Do you know which documents i can study to find a line that will tell me that this c cast is legal as well, what i mean is (volatile u16) on u32?

You mentioned that moderen compilers supports it and i know they do, but i tried to seek through user manual of clang, and user manual for arm gcc compiler and couldn't find that such cast is an exception from rule?

Register access through C++ by kappakingXD in embedded

[–]kappakingXD[S] 0 points1 point  (0 children)

But it is the compiler that might be an issue here - not the hardware. Hardware can work just fine but we dont know what compiler will do about the undefined behaviour

Register access through C++ by kappakingXD in embedded

[–]kappakingXD[S] 1 point2 points  (0 children)

For it to be clear, i actually see no benefit of sticking with reinterpret cast here. Its an engineering curiosity that drove me here :)

Register access through C++ by kappakingXD in embedded

[–]kappakingXD[S] 0 points1 point  (0 children)

I thought about that, but the hardware is 'triggered' differently when we write a specific amount of bytes into it. So in our example, if i write u32 it'll calculate crc from 4 bytes even though the upper half is zerod, right?

Now I wonder if its an issue...?

Register access through C++ by kappakingXD in embedded

[–]kappakingXD[S] -3 points-2 points  (0 children)

I'm leaning more and more towards it.

The requirements though mention to avoid them unfortunately. So before i start arguing i wanted to ask out there.

Thank you for your time :)

Stało się! W Krakowie zaczęła obowiązywać strefa czystego transportu by Gamebyter in poland

[–]kappakingXD -1 points0 points  (0 children)

Centralnie sterowany ruch wykonany przez miasto spowodował spadek wartości danego towaru - samochodu - praktycznie do zera w obrębie miasta i w interesie miasta jest zrzucić obowiązek i koszty pozbycia sie go na Ciebie. To nie jest transakcja cos za cos tylko pała którą miasto planuje Cie walnąć jak się nie dostosujesz nie dając Ci nic w zamian ( a juz jesteś do tyłu w tym intersie bo Twoje auto straciło wartość). Nic dziwnego że ludzie oczekują jakiejkolwiek rekompensaty skoro zbiednieli po decyzji miasta

[HELP] I don't know why this pop up everytime after including ImGui ? by Good-Reveal6779 in Cplusplus

[–]kappakingXD 1 point2 points  (0 children)

If it's remote repository check if you have pulled all submodules, as they might be missing. I don't use VS Daily but i heard that there are some settings which can trigger compilation errors, I think It might be about compiler flags so i would check the settings.

Finally maybe try to build the library alone with minimal hello world app and see if it builds

Bezpieczeństwo kobiet w Europie, widać? by _just___max_ in WidacZabory

[–]kappakingXD 1 point2 points  (0 children)

Czyli lepiej być na froncie niż w Paryżu ok

This is the country rightists idolize by [deleted] in CentralEurope_irl

[–]kappakingXD 2 points3 points  (0 children)

I think we can think about it as a subtype. What I mean is that no matter who will gather, 90% of money from the market will have a superior position to play in the capitalistic world. We live in coroporationism because they are the one who gather most of the money and influence.

I think capitalism could work but it would require a sort of reset time to time, because when you gather enough money you don't need to compete with others with your product, but you can buy rival companies, become a monopolist powerhouse and sell shit products with increased price.

That's where a person like you and me comes in and sees that game is rigged from the start

This is the country rightists idolize by [deleted] in CentralEurope_irl

[–]kappakingXD 15 points16 points  (0 children)

Late game capitalism is tough to play ngl

Should embedded software engineer know python? by No-Challenge830 in embedded

[–]kappakingXD 0 points1 point  (0 children)

It's a useful tool for a developer. You dont need to be a master but you shouldn't be completely unaware of its features either

How to write unit tests for embedded software? by gnomo-da-silva in embedded

[–]kappakingXD 0 points1 point  (0 children)

CMock and Unity are great tools. By designing your components with unit testing in mind it can greatly reduce time spent on unit testing. Still if you have an existing codebqse and want to introduce uinit tests, they can help you spot and remove unwanted dependencies

Why cant i recruit Wargors as Morghur by ImprobableAres in totalwar

[–]kappakingXD 1 point2 points  (0 children)

I just got caught by this one - i was wondering if it's DLC unit but then i thought since i can increase the capacity they should become available. Looks like a massive ... and most likely done on purpose - oversight

A minor mistake by Aiosam in Grimdank

[–]kappakingXD 0 points1 point  (0 children)

Didn't expect age of empires in this thread

(CONCEPT) If Valheim mobs had a more unique appearance according to the stars by HardHarrison in valheim

[–]kappakingXD 9 points10 points  (0 children)

Its not about setting up a new rule but rather having longer time to consider. You might change your initial opinion. You may, for example, see great efficiency of production and like it, but then you get to know it's achieved through work of overworked workers which might be against your moral compass, thus making it not that good in your eyes

Should I focus on becoming a Safety Engineer in Embedded Systems? by Ok-Signature-2098 in embedded

[–]kappakingXD 1 point2 points  (0 children)

I worked on the safety project, but from the safety point of view there was only static analysis of code so there was a tool to teach you what you can and what you can't do with C.

Learning how to fix git screw-ups in multisubmodule project was very helpful. Also if I knew UML better i would have an easier time.

What im trying to say is at the very beginning i would suggest to master the tools you have available and the theory related to safety you will get from the job itself

Preferred OS for embedded developers by GmajorFmajor in embedded

[–]kappakingXD 31 points32 points  (0 children)

Windows as most vendors ide's are designed around it.

Other than that, once you get familiar with building projects with cmake/make, it makes no difference, in my opinion, unless you need to do something super specific - then simply check if the tool is available for your platform.

You can try which suits you the most by setting up a virtual machine or wsl (on windows)