mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 12:55:19 +03:00
Adding RP2350 SDK and target framework (#13988)
* Adding RP2350 SDK and target framework * Spacing * Removing board definitions
This commit is contained in:
parent
462cb05930
commit
2dd6f95aad
576 changed files with 435012 additions and 0 deletions
32
lib/main/pico-sdk/common/pico_time/timeout_helper.c
Normal file
32
lib/main/pico-sdk/common/pico_time/timeout_helper.c
Normal file
|
@ -0,0 +1,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 (time_reached(ts->next_timeout)) {
|
||||
return true;
|
||||
}
|
||||
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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue