|
On 24/02/17 18:16,
schooner30@btinternet wrote:
Just to clarify. setp does not create an event, it merely directly alters the memory area allocated to the param value. setp param_name value comes out as rtapi_mutex_get(&(hal_data_mutex)); *(param_name) = value rtapi_mutex_give(&(hal_data_mutex)); (with a lot of code missed out) Unlike higher level abstractions, where a GUI for instance hooks into the underlying sub-system of the window manager and receives a callback to a nominated function upon an event it is interested in, the components are based upon kernel modules, which are expected to be stand alone entities, requiring the minimum of external resources. It is precisely because of this direct 'bit fiddling' in memory referenced from an offset, which is all based upon the x86 memory map, that the multicore work arose. The v2 components use accessors to pin_ptrs, instead of direct access to pin values. They operate through a lock which ensures that only one access can be made at a time and the value returned is ensured to be the latest one for the pin, via a triple buffer mechanism. The update of values, still does not trigger an event however. There are always many ways to do things, but since the component is attached to a thread and polled every thread cycle, it can do its own checking and then act as appropriate within its own code, upon detecting a relevant change.
-- website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit --- You received this message because you are subscribed to the Google Groups "Machinekit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at https://groups.google.com/group/machinekit. For more options, visit https://groups.google.com/d/optout. |
- [Machinekit] HAL driver dev: call a function whe... Matteo Facchinetti
- Re: [Machinekit] HAL driver dev: call a fun... schooner30@btinternet
- Re: [Machinekit] HAL driver dev: call a... [email protected]
- Re: [Machinekit] HAL driver dev: call a fun... Charles Steinkuehler
