CppCon 2016: Jackie Kay “Lessons Learned From An Embedded RTPS in Modern C++'

preview_player
Показать описание


Software for embedded systems means writing code for a microprocessor with specs straight out of the 80s. But that doesn’t mean that embedded developers should be afraid of using the best tools that modern languages have to offer. This talk will explore embedded development through the source code of a modern C++ implementation of the RTPS (Real-Time Publish/Subscribe) wire protocol. Our targeting ARM STM32 microcontrollers (but generalizable to many platforms). We will put zero-cost abstractions to the test as we attempt to fit a system conforming to a 200-page OMG specification document onto an MCU with 384 KB of RAM and 2048 KB of flash. At a higher level, we will discuss the philosophy of using high-level abstractions in a low-level environment, and seek to settle the score with old-school C microcontroller hackers.

Jackie Kay
Software Engineer, Marble Robotics
I write FOSS tools for the robotics community.


*-----*
*-----*
Рекомендации по теме
Комментарии
Автор

Bss is not for stack-allocated variables, it's for zero-initialized statically allocated variables (non-zero initializer => data, zero initializer => bss).

fo_fo
Автор

At 36:38 insted of void source_callback(void * args){ ... } and void foo_callback(void * args){ ... } .
Can't this code be implemented by:

template<typename TYPE>
void callback(void* args){
auto archive = *>(args);
if (!archive) {
return;
}
TYPE src;
(*archive)(src);
volatile TYPE b = src;
}

and the register_callback will be a MACRO:
#define register_callback_macro(TYPE, callback_map) register_callback(#TYPE, callbacl<TYPE>, callback_map)

With this code the register in main is:

int main(int argc, char** argv) {
...
register_callback_macro(Ack, callback_map);
register_callback_macro(Source, callback_map);
register_callback_macro(Foo, callback_map);

...

lirankarpeles