@@ -181,6 +181,9 @@ struct ticker_user_op_slot_get {
181
181
uint8_t * ticker_id ;
182
182
uint32_t * ticks_current ;
183
183
uint32_t * ticks_to_expire ;
184
+ #if defined(CONFIG_BT_TICKER_REMAINDER_GET )
185
+ uint32_t * remainder ;
186
+ #endif /* CONFIG_BT_TICKER_REMAINDER_GET */
184
187
#if defined(CONFIG_BT_TICKER_LAZY_GET )
185
188
uint16_t * lazy ;
186
189
#endif /* CONFIG_BT_TICKER_LAZY_GET */
@@ -385,10 +388,11 @@ static uint8_t ticker_by_slot_get(struct ticker_node *node, uint8_t ticker_id_he
385
388
* @internal
386
389
*/
387
390
static void ticker_by_next_slot_get (struct ticker_instance * instance ,
388
- uint8_t * ticker_id_head , uint32_t * ticks_current ,
391
+ uint8_t * ticker_id_head ,
392
+ uint32_t * ticks_current ,
389
393
uint32_t * ticks_to_expire ,
390
394
ticker_op_match_func fp_match_op_func ,
391
- void * match_op_context ,
395
+ void * match_op_context , uint32_t * remainder ,
392
396
uint16_t * lazy )
393
397
{
394
398
struct ticker_node * ticker ;
@@ -453,6 +457,13 @@ static void ticker_by_next_slot_get(struct ticker_instance *instance,
453
457
if (_ticker_id_head != TICKER_NULL ) {
454
458
/* Add ticks for found ticker */
455
459
_ticks_to_expire += ticker -> ticks_to_expire ;
460
+
461
+ #if defined(CONFIG_BT_TICKER_REMAINDER_GET )
462
+ if (remainder ) {
463
+ * remainder = ticker -> remainder_current ;
464
+ }
465
+ #endif /* CONFIG_BT_TICKER_REMAINDER_GET */
466
+
456
467
#if defined(CONFIG_BT_TICKER_LAZY_GET )
457
468
if (lazy ) {
458
469
* lazy = ticker -> lazy_current ;
@@ -2262,6 +2273,11 @@ static inline void ticker_job_op_inquire(struct ticker_instance *instance,
2262
2273
#else
2263
2274
NULL , NULL ,
2264
2275
#endif
2276
+ #if defined(CONFIG_BT_TICKER_REMAINDER_GET )
2277
+ uop -> params .slot_get .remainder ,
2278
+ #else /* !CONFIG_BT_TICKER_REMAINDER_GET */
2279
+ NULL ,
2280
+ #endif /* !CONFIG_BT_TICKER_REMAINDER_GET */
2265
2281
#if defined(CONFIG_BT_TICKER_LAZY_GET )
2266
2282
uop -> params .slot_get .lazy );
2267
2283
#else /* !CONFIG_BT_TICKER_LAZY_GET */
@@ -3057,21 +3073,26 @@ uint32_t ticker_next_slot_get(uint8_t instance_index, uint8_t user_id,
3057
3073
ticker_op_func fp_op_func , void * op_context )
3058
3074
{
3059
3075
#if defined(CONFIG_BT_TICKER_LAZY_GET ) || \
3076
+ defined(CONFIG_BT_TICKER_REMAINDER_GET ) || \
3060
3077
defined(CONFIG_BT_TICKER_NEXT_SLOT_GET_MATCH )
3061
3078
return ticker_next_slot_get_ext (instance_index , user_id , ticker_id ,
3062
3079
ticks_current , ticks_to_expire , NULL ,
3063
- NULL , NULL ,
3064
- fp_op_func , op_context );
3080
+ NULL , NULL , NULL , fp_op_func ,
3081
+ op_context );
3065
3082
}
3066
3083
3067
3084
uint32_t ticker_next_slot_get_ext (uint8_t instance_index , uint8_t user_id ,
3068
3085
uint8_t * ticker_id , uint32_t * ticks_current ,
3069
- uint32_t * ticks_to_expire , uint16_t * lazy ,
3086
+ uint32_t * ticks_to_expire ,
3087
+ uint32_t * remainder , uint16_t * lazy ,
3070
3088
ticker_op_match_func fp_match_op_func ,
3071
3089
void * match_op_context ,
3072
3090
ticker_op_func fp_op_func , void * op_context )
3073
3091
{
3074
- #endif /* CONFIG_BT_TICKER_LAZY_GET || CONFIG_BT_TICKER_NEXT_SLOT_GET_MATCH */
3092
+ #endif /* CONFIG_BT_TICKER_LAZY_GET ||
3093
+ * CONFIG_BT_TICKER_REMAINDER_GET ||
3094
+ * CONFIG_BT_TICKER_NEXT_SLOT_GET_MATCH
3095
+ */
3075
3096
struct ticker_instance * instance = & _instance [instance_index ];
3076
3097
struct ticker_user_op * user_op ;
3077
3098
struct ticker_user * user ;
@@ -3094,6 +3115,9 @@ uint32_t ticker_next_slot_get_ext(uint8_t instance_index, uint8_t user_id,
3094
3115
user_op -> params .slot_get .ticker_id = ticker_id ;
3095
3116
user_op -> params .slot_get .ticks_current = ticks_current ;
3096
3117
user_op -> params .slot_get .ticks_to_expire = ticks_to_expire ;
3118
+ #if defined(CONFIG_BT_TICKER_REMAINDER_GET )
3119
+ user_op -> params .slot_get .remainder = remainder ;
3120
+ #endif /* CONFIG_BT_TICKER_REMAINDER_GET */
3097
3121
#if defined(CONFIG_BT_TICKER_LAZY_GET )
3098
3122
user_op -> params .slot_get .lazy = lazy ;
3099
3123
#endif /* CONFIG_BT_TICKER_LAZY_GET */
0 commit comments