Zdravím chtěl bych se zeptat, jaký je rozdíl mezi klasickým programováním v c++ a embedded ? Princip programování je stejný či se nějak liší ? Díky za odpověď
Fórum › C / C++
Embedded C++

Jestli je tim embedded c++ mysleno pro mikrokontrolery, tak jsou tam jiste rozdily.
Napriklad pro AVR je jen naprosto ciste C++, zadne STL a tak. Vetsinou jsou vyple i vyjimky a RTTI. Kontejnery jsou vynechany hlavne proto, ze je straslive malo pameti a vetsina z nich pouziva dynamickou pamet. Par operaci a pamet muze byt tak zfragmentovana, ze je konec... Takove Arduino ma vlastni (ne moc hezkou/povedenou) implementaci stringu (String). A zacatecnici radi pouzijou neco jako: String retezec = "...."; retezec += cislo + "retezec" + ........................; No a pak se divi, jak programy divne nefungujou nebo fungujou jen nejaky cas.
U ARM procesoru uz je vetsinou podpora vcetne kontejneru a tak. Pameti je mnohem vice, to ale neznamena, ze je dobry napad je pouzivat neja presprilis. Obvykle je take moznost prepinat mezi Reduced C++ a Full. Ale nikdy sem nezkoumal, jake jsou tam rozdily.
Taktez jsou velke rozdily ve velikostech datovych typu podle toho, jestli je procesor 8/16/32/64b. Pouzivani float na procesorech bez hardwarove podpory je super pomale. Takove AVR napriklad nema ani celociselne deleni, takze je to vse pomoci funkci misto instrukci. Zalezi co pocitas a jak rychle to potrebujes.
Vse zalezi na zvolenem procesoru.
#1 Kenvelo
Řekl bych, že základní princip programování je stejný, jen je potřeba brát v úvahu HW a Systémové možnosti zařízení.
U HW jde o druh a typ procesoru velikosti a druhy pamětí apod,
Systémové možnosti závisí na platformě operačního systému, trošku jinak se programuje pro Windows, Windows S/RE, linux (různé distribuce), IOS, Android atd.
Vetšinou je třeba použít odpovídající knihovny případně si knihovnu udělat.

Přidej příspěvek
Ano, opravdu chci reagovat → zobrazí formulář pro přidání příspěvku
×Vložení zdrojáku
×Vložení obrázku
×Vložení videa
































Uživatelé prohlížející si toto vlákno
Podobná vlákna
C++/embedded — založil Goodcall.eu
EMBEDDED TESTER — založil DenisaO
Senior Tester for Embedded Systems — založil Honeywell
Embedded- Test engineer (Brno) — založil embedded testers
Vývojář/ka Embedded Software C (Praha) na projekt pro Evropskou vesm… — založil evolvsys
Moderátoři diskuze