zephyr/subsys/bluetooth/controller/util/mayfly.h
Carles Cufi a6e157b61a Bluetooth: Controller: Fix alignment issues from new integer types
The switch from C99 integer types to u16_t, etc. caused misalignment
in structs and function definitions with multi-line parameter lists.

Change-Id: I1448b159ab1afe50ff88b7a6bd1b254c44858d4c
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-04-29 11:39:13 -04:00

38 lines
989 B
C

/*
* Copyright (c) 2016 Nordic Semiconductor ASA
* Copyright (c) 2016 Vinayak Kariappa Chettimada
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _MAYFLY_H_
#define _MAYFLY_H_
#define MAYFLY_CALL_ID_0 0
#define MAYFLY_CALL_ID_1 1
#define MAYFLY_CALL_ID_2 2
#define MAYFLY_CALL_ID_PROGRAM 3
#define MAYFLY_CALLER_COUNT 4
#define MAYFLY_CALLEE_COUNT 4
struct mayfly {
u8_t volatile _req;
u8_t _ack;
void *_link;
void *param;
void (*fp)(void *);
};
void mayfly_init(void);
void mayfly_enable(u8_t caller_id, u8_t callee_id, u8_t enable);
u32_t mayfly_enqueue(u8_t caller_id, u8_t callee_id, u8_t chain,
struct mayfly *m);
void mayfly_run(u8_t callee_id);
extern void mayfly_enable_cb(u8_t caller_id, u8_t callee_id, u8_t enable);
extern u32_t mayfly_is_enabled(u8_t caller_id, u8_t callee_id);
extern u32_t mayfly_prio_is_equal(u8_t caller_id, u8_t callee_id);
extern void mayfly_pend(u8_t caller_id, u8_t callee_id);
#endif /* _MAYFLY_H_ */