Skip to content

Modules initialization

Daniele Lacamera edited this page Dec 22, 2015 · 3 revisions

The current implementation of the picoTCP core is just one of the possible combination of the internal structure for the modules. The modules selected at compile time could be as well loaded later on at runtime if needed.
The approach taken here is the simplest possible: the modules are statically defined as global objects, and pico_stack_init initiates the configuration of the protocols. From that moment on, the scheduler in pico_stack_tick can run the processing functions for both directions in a given order.

Device drivers initialization is slightly different, because it must be issued by the application developer. The functions to initialize the device drivers are specific for the single driver implementation, and the only requirement is that the device initializer must call the pico_device_init function on the generic pico_device object. Once the devices are correctly initialized, their module will be part of the stack and the poll function, if defined, will be called at regular intervals.

Clone this wiki locally