This section contains common operations that can be used to schedule callbacks.
More...
This section contains common operations that can be used to schedule callbacks.
◆ oc_activate_interrupt_handler
#define oc_activate_interrupt_handler |
( |
|
name | ) |
(oc_process_start(&(name##_interrupt_x), 0)) |
activate the interrupt handler
Definition at line 1718 of file oc_api.h.
◆ oc_define_interrupt_handler
#define oc_define_interrupt_handler |
( |
|
name | ) |
|
Value: void name##_interrupt_x_handler(void); \
OC_PROCESS(name##_interrupt_x, ""); \
OC_PROCESS_THREAD(name##_interrupt_x, ev, data) \
{ \
(void)data; \
OC_PROCESS_POLLHANDLER(name##_interrupt_x_handler()); \
OC_PROCESS_BEGIN(); \
while (oc_process_is_running(&(name##_interrupt_x))) { \
OC_PROCESS_YIELD(); \
} \
OC_PROCESS_END(); \
} \
void name##_interrupt_x_handler(void)
define the interrupt handler
Definition at line 1722 of file oc_api.h.
◆ oc_signal_interrupt_handler
#define oc_signal_interrupt_handler |
( |
|
name | ) |
|
Value: do { \
oc_process_poll(&(name##_interrupt_x)); \
_oc_signal_event_loop(); \
} while (0)
API for setting handlers for interrupts.
Definition at line 1711 of file oc_api.h.
◆ oc_remove_delayed_callback()
void oc_remove_delayed_callback |
( |
void * |
cb_data, |
|
|
oc_trigger_t |
callback |
|
) |
| |
used to cancel a delayed callback
- Parameters
-
[in] | cb_data | the user defined context pointer that was passed to the oc_sed_delayed_callback() function |
[in] | callback | the delayed callback that is being removed |
◆ oc_set_delayed_callback()
void oc_set_delayed_callback |
( |
void * |
cb_data, |
|
|
oc_trigger_t |
callback, |
|
|
uint16_t |
seconds |
|
) |
| |
Schedule a callback to be invoked after a set number of seconds.
- Parameters
-
[in] | cb_data | user defined context pointer that is passed to the oc_trigger_t callback |
[in] | callback | the callback invoked after the set number of seconds |
[in] | seconds | the number of seconds to wait till the callback is invoked |
◆ oc_set_delayed_callback_ms()
void oc_set_delayed_callback_ms |
( |
void * |
cb_data, |
|
|
oc_trigger_t |
callback, |
|
|
uint16_t |
miliseconds |
|
) |
| |
Schedule a callback to be invoked after a set number of miliseconds.
- Parameters
-
[in] | cb_data | user defined context pointer that is passed to the oc_trigger_t callback |
[in] | callback | the callback invoked after the set number of seconds |
[in] | miliseconds | the number of miliseconds to wait till the callback is invoked |