Select one of the symbols to view example projects that use it.
 
Outline
#include "pico/timeout_helper.h"
check_single_timeout_us(timeout_state_t *, bool)
init_single_timeout_until(timeout_state_t *, absolute_time_t)
check_per_iteration_timeout_us(timeout_state_t *, bool)
init_per_iteration_timeout_us(timeout_state_t *, uint64_t)
Files
loading...
SourceVuRaspberry Pi Pico SDK and ExamplesPicoSDKsrc/common/pico_time/timeout_helper.c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. * * SPDX-License-Identifier: BSD-3-Clause *//* ... */ #include "pico/timeout_helper.h" static bool check_single_timeout_us(timeout_state_t *ts, __unused bool reset) { return time_reached(ts->next_timeout); }{ ... } check_timeout_fn init_single_timeout_until(timeout_state_t *ts, absolute_time_t target) { ts->next_timeout = target; return check_single_timeout_us; }{ ... } static bool check_per_iteration_timeout_us(timeout_state_t *ts, bool reset) { if (reset) { ts->next_timeout = make_timeout_time_us(ts->param); }if (reset) { ... } if (time_reached(ts->next_timeout)) { return true; }if (time_reached(ts->next_timeout)) { ... } return false; }{ ... } check_timeout_fn init_per_iteration_timeout_us(timeout_state_t *ts, uint64_t per_iteration_timeout_us) { ts->next_timeout = make_timeout_time_us(per_iteration_timeout_us); ts->param = per_iteration_timeout_us; return check_per_iteration_timeout_us; }{ ... }
Details