mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-10 17:23:32 +00:00
Controller asserted in preparation of a role event due to the previous (same or another) role event preparation being not complete. Mayfly callee was disabled in the previous event due to the preparation time being short and previous start running (higher natural priority) before all previous preparation mayfly completed. The previous start disabled mayfly to avoid Radio ISR latencies. The current role event that asserted, preempted the previous role (observer role with continuous scanning window) which runs until preemption to maximise the Radio h/w use (observer scanning until next interval). The previous preparation mayfly is still disabled when the current role preparation tries to use same mayfly instance which should be free for a new enqueue. This commit updates mayfly implementation so that mayfly callee is disabled only after all enqueued mayfly instances are run to completion. Jira: ZEP-1839 Change-id: I3e0d31422db8e47b819189110b11ebd07dd09a7c Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
32 lines
857 B
C
32 lines
857 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_
|
|
|
|
struct mayfly {
|
|
uint8_t volatile _req;
|
|
uint8_t _ack;
|
|
void *_link;
|
|
void *param;
|
|
void (*fp)(void *);
|
|
};
|
|
|
|
void mayfly_init(void);
|
|
void mayfly_enable(uint8_t caller_id, uint8_t callee_id, uint8_t enable);
|
|
uint32_t mayfly_enqueue(uint8_t caller_id, uint8_t callee_id, uint8_t chain,
|
|
struct mayfly *m);
|
|
void mayfly_run(uint8_t callee_id);
|
|
|
|
extern void mayfly_enable_cb(uint8_t caller_id, uint8_t callee_id,
|
|
uint8_t enable);
|
|
extern uint32_t mayfly_is_enabled(uint8_t caller_id, uint8_t callee_id);
|
|
extern uint32_t mayfly_prio_is_equal(uint8_t caller_id, uint8_t callee_id);
|
|
extern void mayfly_pend(uint8_t caller_id, uint8_t callee_id);
|
|
|
|
#endif /* _MAYFLY_H_ */
|