join analogs and gyroscope

This commit is contained in:
Denis 2024-01-03 15:39:19 +01:00
parent d208f5dc2a
commit 026e970615
No known key found for this signature in database
GPG key ID: DD9B63F805CF5C03
8 changed files with 90 additions and 0 deletions

View file

@ -5,3 +5,9 @@ int32_t div_round_closest(int32_t x, int32_t divisor) {
const int32_t __d = divisor;
return ((__x) > 0) == ((__d) > 0) ? (((__x) + ((__d) / 2)) / (__d)) : (((__x) - ((__d) / 2)) / (__d));
}
int64_t div_round_closest_i64(int64_t x, int64_t divisor) {
const int64_t __x = x;
const int64_t __d = divisor;
return ((__x) > 0) == ((__d) > 0) ? (((__x) + ((__d) / 2)) / (__d)) : (((__x) - ((__d) / 2)) / (__d));
}